-
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
Add inline example for grdvolume #1726
Conversation
Co-authored-by: Michael Grund <[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.
Looks good to me except a typo.
Need to fix the styling issue before merge. |
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Meghan Jones <[email protected]>
Co-authored-by: Meghan Jones <[email protected]>
>>> # maximum to 400, and the interval to 50. | ||
>>> output_array = pygmt.grdvolume( | ||
... grid=grid, contour=[200, 400, 50], output_type="numpy" | ||
... ) | ||
""" |
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.
Ideally, we would have nice column names like in grdhisteq
:
Lines 301 to 309 in d85bfdf
>>> bins = pygmt.grdhisteq.compute_bins(grid=grid, divisions=5) | |
>>> print(bins) | |
start stop | |
bin_id | |
0 179.0 397.5 | |
1 397.5 475.5 | |
2 475.5 573.5 | |
3 573.5 710.5 | |
4 710.5 2103.0 |
But for the sake of time, and just finish this inline example, let's go with this:
""" | |
>>> print(output_dataframe) | |
0 1 2 3 | |
0 200 2.144285e+12 7.972228e+14 371.789489 | |
1 250 2.104042e+12 6.908183e+14 328.329232 | |
2 300 2.014978e+12 5.877195e+14 291.675420 | |
3 350 1.892109e+12 4.897545e+14 258.840510 | |
4 400 1.744792e+12 3.988316e+14 228.584026 | |
""" |
Co-authored-by: Wei Ji <[email protected]>
Co-authored-by: Wei Ji <[email protected]>
* Add an inline example to grdvolume.py Co-authored-by: Michael Grund <[email protected]> Co-authored-by: Dongdong Tian <[email protected]> Co-authored-by: Meghan Jones <[email protected]> Co-authored-by: Wei Ji <[email protected]>
This PR adds an inline code example to the docstring for
grdvolume
.Addresses #1686
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