File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11
11
from inspect import Parameter , signature
12
12
13
13
import numpy as np
14
+ import pygmt
14
15
from pygmt .exceptions import GMTInvalidInput
15
16
from pygmt .helpers .utils import is_nonstr_iter
16
17
@@ -857,7 +858,14 @@ def new_module(*args, **kwargs):
857
858
New module instance that raises a warning if positional arguments
858
859
are passed.
859
860
"""
860
- if len (args ) > 0 : # positional arguments are used
861
+ # plotting function always has the "self" parameter
862
+ if len (args ) > 1 and isinstance (args [0 ], pygmt .Figure ):
863
+ plotting_func = 1
864
+ else :
865
+ plotting_func = 0
866
+
867
+ if len (args ) > 1 + plotting_func :
868
+ # more than one positional arguments are used
861
869
msg = (
862
870
"The function parameters has been re-ordered as 'data, x, y, [z]' "
863
871
f"since { deprecate_version } but you're passing positional arguments. "
You can’t perform that action at this time.
0 commit comments