Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Dec 8, 2025

This PR adds suffix support to the Alias class, which is necessary to support some options, e.g., wiggle's -G option has a syntax -Gfill[+n][+p]. Currently, we have to write a custom function to parse the argument. With the suffix support, it can be greatly simplified.

@seisman seisman added enhancement Improving an existing feature needs review This PR has higher priority and needs review. labels Dec 9, 2025
@seisman seisman added this to the 0.18.0 milestone Dec 9, 2025
# - If any Alias has a suffix, return a list of values, for repeated GMT options
# like -Cblue+l -Cred+r
# - Otherwise, concatenate into a single string for combined modifiers like
# -BWSen+ttitle+gblue.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

        G=[
            Alias(fillpositive, name="fillpositive", suffix="+p"),
            Alias(fillnegative, name="fillnegative", suffix="+n"),
        ],

Taking wiggle's -G option as an example. In the previous version, the values will be concatenated into a single string, so fillpositive="blue", fillnegative="red" will be -Gblue+pred+n, which is invalid.

I've updated the logic of AliasSystem, so that it will return a list of values, rather than concatenating them, when any Alias has a suffix.

@seisman seisman marked this pull request as ready for review December 9, 2025 02:51
@seisman seisman marked this pull request as draft December 11, 2025 01:55
@seisman seisman removed the needs review This PR has higher priority and needs review. label Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improving an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants