GeezerVison is showing github.com — pygmt.binstats: Let the parameter 'statistic' support descriptive arguments by seisman · Pull Request #3012 · GenericMappingTools/pygmt
Conversation
seisman
commented
Jan 17, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
seisman
changed the title
POC: pygmt.binstats: Make the 'statistic' parameter more Pythonic
WIP: pygmt.binstats: Make the 'statistic' parameter more Pythonic
Jul 26, 2025
seisman
changed the title
WIP: pygmt.binstats: Make the 'statistic' parameter more Pythonic
pygmt.binstats: Let the parameter 'statistic' support long-form arguments
Aug 3, 2025
Uh oh!
There was an error while loading. Please reload this page.
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 |
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
seisman
changed the title
pygmt.binstats: Let the parameter 'statistic' support long-form arguments
pygmt.binstats: Let the parameter 'statistic' support descriptive arguments
Aug 8, 2025
Uh oh!
There was an error while loading. Please reload this page.
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|