Skip to content

Commit 12799f4

Browse files
committed
Fix the check_data_input_order decorator
1 parent 7b2ff17 commit 12799f4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pygmt/helpers/decorators.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,10 @@ def new_module(*args, **kwargs):
857857
New module instance that raises a warning if positional arguments
858858
are passed.
859859
"""
860-
if len(args) > 0: # positional arguments are used
860+
# plotting function always has the "self" parameter
861+
plotting_func = 1 if len(args) > 1 and isinstance(args[0], object) else 0
862+
if len(args) > 1 + plotting_func:
863+
# more than one positional arguments are used
861864
msg = (
862865
"The function parameters has been re-ordered as 'data, x, y, [z]' "
863866
f"since {deprecate_version} but you're passing positional arguments. "

0 commit comments

Comments
 (0)