@@ -450,9 +450,7 @@ def fmt_docstring(module_func):
450
450
aliases .append (" :columns: 3\n " )
451
451
for arg in sorted (module_func .aliases ):
452
452
alias = module_func .aliases [arg ]
453
- # Trailing dash means it's not aliased but should be listed.
454
- # Remove the trailing dash if it exists.
455
- aliases .append (f" - { arg } = { alias .rstrip ('-' )} " )
453
+ aliases .append (f" - { arg } = { alias } " )
456
454
filler_text ["aliases" ] = "\n " .join (aliases )
457
455
458
456
filler_text ["table-classes" ] = (
@@ -486,9 +484,6 @@ def _insert_alias(module_func, default_value=None):
486
484
kwargs_param = wrapped_params .pop (- 1 )
487
485
# Add new parameters from aliases
488
486
for alias in module_func .aliases .values ():
489
- if alias .endswith ("-" ):
490
- # Trailing dash means it's not aliased but should be listed.
491
- continue
492
487
if alias not in sig .parameters :
493
488
new_param = Parameter (
494
489
alias , kind = Parameter .KEYWORD_ONLY , default = default_value
@@ -553,31 +548,6 @@ def new_module(*args, **kwargs):
553
548
New module that parses and replaces the registered aliases.
554
549
"""
555
550
for short_param , long_alias in aliases .items ():
556
- if long_alias .endswith ("-" ):
557
- _long_alias = long_alias .rstrip ("-" )
558
- # Trailing dash means it's not aliased but should be listed.
559
- _alias_list = _long_alias .split ("/" )
560
- if (
561
- any (_alias in kwargs for _alias in _alias_list )
562
- and short_param in kwargs
563
- ): # Both long- and short- forms are given.
564
- msg = (
565
- f"Parameters in short-form ({ short_param } ) and "
566
- f"long-form ({ _long_alias } ) can't coexist."
567
- )
568
- raise GMTInvalidInput (msg )
569
- if short_param in kwargs : # Only short-alias is given
570
- if len (_alias_list ) > 1 : # Aliased to multiple long-forms
571
- msg = (
572
- f"Short-form parameter ({ short_param } ) is not "
573
- f"recognized. Use long-form parameter(s) "
574
- f"'{ _long_alias } ' instead."
575
- )
576
- raise GMTInvalidInput (msg )
577
- # If there is only one long-form parameter, use it.
578
- kwargs [_long_alias ] = kwargs .pop (short_param )
579
- continue
580
-
581
551
if long_alias in kwargs and short_param in kwargs :
582
552
msg = (
583
553
f"Parameters in short-form ({ short_param } ) and "
0 commit comments