-
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 grd2xyz #1284
Wrap grd2xyz #1284
Conversation
pygmt/tests/test_grd2xyz.py
Outdated
Make sure grd2xyz works as expected. | ||
""" | ||
xyz_data = grd2xyz(grid=grid) | ||
assert xyz_data.strip().split("\n") == [ |
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.
Quick comment: I don't think a string-type output is useful. The function should either return numpy 1d/2d arrays or pandas.DataFrame.
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.
@seisman could you look at what I just added? As far as I can tell it is working correctly.
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.
We might need to open an issue to discuss the output format. Currently, the blockm*/grdtrack modules simply outputs pandas.DataFrame/filenames (see #1099) automatically depending on the input type (2 options). The implementation @willschlitzer made at bf58dc2 and 68fab7c returns either numpy/pandas/str depending on the user input (3 options). Best to be consistent across PyGMT on the types of outputs users can expect.
@willschlitzer, I'll set this PR to 'draft' mode to conserve CI resources since it might take a while to settle on the output format types (as mentioned in #1284 (comment)). Also on a related note, please go easy on clicking the 'Update branch' button since it uses CI resources and also triggers notifications to all maintainers (double notifications if the tests happen to fail). I know you're keen on getting more PRs in (and we do welcome new features!), but there are better ways to merge in a sequence of PRs one after another. For example with 5 PRs, instead of clicking 'Update branch' 5+4+3+2+1=15 times (updating every PR after one is merged), we can click 'Update branch' 1+1+1+1+1=5 times (updating only the 1 PR that is going to be merged next). |
Co-authored-by: Wei Ji <[email protected]> Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
I think this PR is already good for merging, but it would be better if @meghanrjones can also give it a final review, since @meghanrjones made a lot of suggestions in this 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.
Great work, Will!
Co-authored-by: Meghan Jones <[email protected]> Co-authored-by: Wei Ji <[email protected]> Co-authored-by: Dongdong Tian <[email protected]>
This pull request wraps the
grd2xyz
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