-
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 grdfill #1276
Wrap grdfill #1276
Conversation
@GenericMappingTools/pygmt-contributors Any ideas for how to test this? I have downloaded grid files from scientific cruises to ensure I have gaps in the data that need to be filled, but I'm not sure how to write a test that retrieves an unfilled grid from something like |
You can manual set one or more of the data values in grids from
|
Thanks @meghanrjones! |
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.
Looks good to me.
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.
Looks good to me. Great work!
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.
Looks great. Only two minor comments.
pygmt/src/grdfill.py
Outdated
Specify the hole-filling algorithm to use. Choose from **c** for | ||
constant fill and append the constant value, **n** for nearest | ||
neighbor (and optionally append a search radius in | ||
pixels [default radius is `r^2 = sqrt(X^2 + Y^2)`, |
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.
LaTeX formula?
pixels [default radius is `r^2 = sqrt(X^2 + Y^2)`, | |
pixels [default radius is :math:`r^2 = \sqrt{X^2 + Y^2}`, |
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.
If you want to use the math
directive, it should be:
:math:`r^2 = \sqrt{X^2 + Y^2}`
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.
If you want to use the
math
directive, it should be::math:`r^2 = \sqrt{X^2 + Y^2}`
updated~ Thanks
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.
@willschlitzer previously had this in there - it did not work because fmt_docstring
tries to insert common text into the brackets. So, it either needs to stay as non-sphinx math or fmt_docstring
needs to be modified.
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.
If we want LaTeX math, we may need to use double curly braces
:math:`r^2 = \sqrt{{ X^2 + Y^2 }}`
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.
If we want LaTeX math, we may need to use double curly braces
:math:`r^2 = \sqrt{{ X^2 + Y^2 }}`
This appears to be working!
What is the preferred was for denoting required parameters? I think there should be some indication in the method docs that |
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.
Just some suggestions to improve the unit tests (smaller grid for speed + more robust checks) 😁 I've also thrown in some np.inf
values just to see if GMT would fill them in.
What is the preferred was for denoting required parameters? I think there should be some indication in the method docs that
mode
(-A) is required.
Perhaps just a one-line description in the docstring wll suffice?
Co-authored-by: Yao Jiayuan <coreman.seism@gmail.com> Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Wrap the gmt module grdfill and create test_grdfill.py. Co-authored-by: Yao Jiayuan <coreman.seism@gmail.com> Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
This pull request wraps the
grdfill
module.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