File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -359,7 +359,7 @@ def use_alias(**aliases):
359
359
Traceback (most recent call last):
360
360
...
361
361
pygmt.exceptions.GMTInvalidInput:
362
- Arguments in short-form (J) and long-form (projection) can't coexist
362
+ Parameters in short-form (J) and long-form (projection) can't coexist.
363
363
"""
364
364
365
365
def alias_decorator (module_func ):
@@ -375,10 +375,16 @@ def new_module(*args, **kwargs):
375
375
for arg , alias in aliases .items ():
376
376
if alias in kwargs and arg in kwargs :
377
377
raise GMTInvalidInput (
378
- f"Arguments in short-form ({ arg } ) and long-form ({ alias } ) can't coexist"
378
+ f"Parameters in short-form ({ arg } ) and long-form ({ alias } ) can't coexist. "
379
379
)
380
380
if alias in kwargs :
381
381
kwargs [arg ] = kwargs .pop (alias )
382
+ elif arg in kwargs :
383
+ msg = (
384
+ f"Short-form parameter ({ arg } ) is not recommended. "
385
+ f"Use long-form parameter '{ alias } ' instead."
386
+ )
387
+ warnings .warn (msg , category = FutureWarning , stacklevel = 2 )
382
388
return module_func (* args , ** kwargs )
383
389
384
390
new_module .aliases = aliases
You can’t perform that action at this time.
0 commit comments