Skip to content

Commit

Permalink
Fix the check_data_input_order decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Sep 27, 2021
1 parent 7b2ff17 commit 12799f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pygmt/helpers/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,10 @@ def new_module(*args, **kwargs):
New module instance that raises a warning if positional arguments
are passed.
"""
if len(args) > 0: # positional arguments are used
# plotting function always has the "self" parameter
plotting_func = 1 if len(args) > 1 and isinstance(args[0], object) else 0
if len(args) > 1 + plotting_func:
# more than one positional arguments are used
msg = (
"The function parameters has been re-ordered as 'data, x, y, [z]' "
f"since {deprecate_version} but you're passing positional arguments. "
Expand Down

0 comments on commit 12799f4

Please sign in to comment.