-
Notifications
You must be signed in to change notification settings - Fork 224
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
Wrap grdclip #1261
Wrap grdclip #1261
Conversation
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
pygmt/src/grdclip.py
Outdated
between : str or list or tuple | ||
[*low*, *high*, *between*]. | ||
Set all data[i] >= *low* and <= *high* to *between*. | ||
Repeat the option for as many intervals as are needed. |
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.
Repeat the option for as many intervals as are needed.
It's impossible to repeat the option in Python.
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.
What if we could do it like frame (-B) in fig.basemap
and pass in a list? Something like between=['0/2/1', '3/5/4']
? Or a list of tuples like between=[(0, 2 ,1), (3, 5 ,4)]
that expands to -Sb0/2/1 -Sb3/5/4
in GMT.
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.
between=[(0, 2 ,1), (3, 5 ,4)]
makes sense to me, but it needs more coding afforts.
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.
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.
Actually I was thinking of handling this feature by changing Sb='sequence'
. Perhaps implementing a sequence_tuple
? But yes, this can be done in a separate enhancement PR.
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.
this can be done in a separate enhancement PR.
I agree.
Co-authored-by: Dongdong Tian <[email protected]>
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.
Good work @willschlitzer! After you merge this in (remember to tidy the commit message), please open up an issue to handle the enhancement mentioned at #1261 (comment). Thanks!
Wrap the gmt function grdclip and add tests for it. Co-authored-by: Wei Ji <[email protected]> Co-authored-by: Dongdong Tian <[email protected]> Co-authored-by: Wei Ji <[email protected]>
Wraps the gmt function grdclip.
Fixes #
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version