-
Notifications
You must be signed in to change notification settings - Fork 235
AliasSystem: Support adding a suffix to a value and simplify Figure.wiggle #4259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| # - 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. |
There was a problem hiding this comment.
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.
This PR adds
suffixsupport to theAliasclass, which is necessary to support some options, e.g.,wiggle's-Goption has a syntax-Gfill[+n][+p]. Currently, we have to write a custom function to parse the argument. With thesuffixsupport, it can be greatly simplified.