-
Notifications
You must be signed in to change notification settings - Fork 229
pygmt.binstats: Let the parameter 'statistic' support descriptive arguments #3012
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
Conversation
de6ffcc
to
464b170
Compare
d1bc357
to
628e69e
Compare
628e69e
to
e1756bf
Compare
7f190d8
to
8883dd8
Compare
8883dd8
to
6df2d83
Compare
Co-authored-by: Yvonne Fröhlich <[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.
Pull Request Overview
This PR refactors the pygmt.binstats
function to support long-form arguments for the statistic
parameter, replacing short single-letter codes with descriptive names (e.g., statistic="mean"
instead of statistic="a"
).
Key changes:
- Implemented an alias system to map long-form statistic names to their corresponding short-form GMT codes
- Added type hints and explicit parameter definitions for better API usability
- Updated tests to use the new long-form syntax
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
pygmt/src/binstats.py | Adds alias system, type hints, and long-form parameter support for statistic names |
pygmt/tests/test_binstats.py | Updates existing tests to use long-form statistic names and adds new quantile test |
Co-authored-by: Copilot <[email protected]>
Description of proposed changes
Refactor using the new alias system to make the parameter
statistic
support long-form arguments likestatistic="mean"
instead ofstatistic="a"
.Upstream documentation at https://docs.generic-mapping-tools.org/dev/gmtbinstats.html
Long-form arguments come from https://github.com/GenericMappingTools/gmt/blob/0ae77bb0ae34d6dcb331156d7ee17a747ba83c57/src/longopt/gmtbinstats_inc.h#L29
Preview: https://pygmt-dev--3012.org.readthedocs.build/en/3012/api/generated/pygmt.binstats.html
Address #1651.