Skip to content

Commit

Permalink
Make inserted alias parameters KEYWORD_ONLY
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrjones committed May 23, 2021
1 parent dc25707 commit f37faea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pygmt/helpers/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def fmt_docstring(module_func):
return module_func


def insert_alias(module_func):
def insert_alias(module_func, default_value=None):
"""
Decorator insertings aliases into the signature of a method.
"""
Expand All @@ -275,7 +275,7 @@ def insert_alias(module_func):
for alias in module_func.aliases.values():
if alias not in sig.parameters.keys():
new_param = Parameter(
alias, kind=Parameter.POSITIONAL_OR_KEYWORD, default=None
alias, kind=Parameter.KEYWORD_ONLY, default=default_value
)
wrapped_params = wrapped_params + [new_param]
all_params = wrapped_params + [kwargs_param]
Expand Down

0 comments on commit f37faea

Please sign in to comment.