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! |
michaelgrund
left a comment
There was a problem hiding this comment.
Looks good to me. Great work!
core-man
left a comment
There was a problem hiding this comment.
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.
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.
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.
If you want to use the
mathdirective, it should be::math:`r^2 = \sqrt{X^2 + Y^2}`
updated~ Thanks
There was a problem hiding this comment.
@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.
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.
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 |
weiji14
left a comment
There was a problem hiding this comment.
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
grdfillmodule.Fixes #
Reminders
make formatandmake checkto 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