GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pygmt.binstats: Let the parameter 'statistic' support descriptive arguments by seisman · Pull Request #3012 · GenericMappingTools/pygmt

Conversation

@seisman

@seisman seisman commented Jan 17, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Description of proposed changes

Refactor using the new alias system to make the parameter statistic support long-form arguments like statistic="mean" instead of statistic="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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@seisman seisman mentioned this pull request May 10, 2024
New alias system towards a more Pythonic interface #3239
Closed
4 tasks done
@seisman
seisman force-pushed the binstats/statistic branch 2 times, most recently from de6ffcc to 464b170 Compare September 29, 2024 09:27
@seisman seisman self-assigned this Oct 30, 2024
@seisman seisman mentioned this pull request May 25, 2025
Figure.coast/pygmt.select/pygmt.grdlandmask: Use long names ("crude"/"low"/"intermediate"/"high"/"full") for the 'resolution' parameter #3013
Merged
@seisman
seisman force-pushed the binstats/statistic branch from d1bc357 to 628e69e Compare July 23, 2025 06:53
@seisman
seisman changed the base branch from main to AliasSystem/aliassystem July 23, 2025 06:53
@seisman
seisman force-pushed the binstats/statistic branch from 628e69e to e1756bf Compare July 24, 2025 06:28
@seisman seisman added the enhancement Improving an existing feature label Jul 24, 2025
@seisman seisman added this to the 0.17.0 milestone Jul 24, 2025
@seisman 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 seisman mentioned this pull request Jul 26, 2025
POC: Implement the new alias system, general parameter classes and some refactors #3238
Closed
Base automatically changed from AliasSystem/aliassystem to main July 29, 2025 04:09
@seisman
seisman force-pushed the binstats/statistic branch 3 times, most recently from 7f190d8 to 8883dd8 Compare August 3, 2025 04:16
@seisman
pygmt.binstats: Let the parameter 'statistic' support long-form argum…
6df2d83
…ents
@seisman
seisman force-pushed the binstats/statistic branch from 8883dd8 to 6df2d83 Compare August 3, 2025 04:19
@seisman
seisman marked this pull request as ready for review August 3, 2025 04:19
@seisman 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
@seisman seisman added the needs review This PR has higher priority and needs review. label Aug 3, 2025
@seisman
Add a test to increase coverage
4779c36
@seisman
seisman requested a review from a team August 7, 2025 08:24
yvonnefroehlich
yvonnefroehlich reviewed Aug 7, 2025
View reviewed changes
Comment thread pygmt/src/binstats.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

seisman and others added 2 commits August 7, 2025 20:04
@seisman @yvonnefroehlich
Update pygmt/src/binstats.py
9138a4c
Co-authored-by: Yvonne Fröhlich <[email protected]>
@seisman
Merge branch 'main' into binstats/statistic
b0f33bb
@seisman
seisman requested review from a team and Copilot August 8, 2025 04:09
Copilot AI reviewed Aug 8, 2025
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

All reactions
Comment thread pygmt/src/binstats.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pygmt/tests/test_binstats.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@seisman
Add C to alias docstring
40cdc59
@seisman
Update pygmt/tests/test_binstats.py
1c1c144
Co-authored-by: Copilot <[email protected]>
@seisman 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
michaelgrund
michaelgrund approved these changes Aug 8, 2025
View reviewed changes
@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Aug 9, 2025
seisman added 2 commits August 9, 2025 22:55
@seisman
Reformat descriptive arguments
153af66
@seisman
Update the description of arguments to match upstream docs
ae6fc3c
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Aug 10, 2025
@seisman
seisman merged commit 2bc5931 into main Aug 10, 2025
@seisman
seisman deleted the binstats/statistic branch August 10, 2025 05:34
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Pythonic GMT arguments Aug 10, 2025
@weiji14 weiji14 mentioned this pull request Sep 15, 2025
Mark test_binstats_quantile as xfail in the GMT Legacy Tests workflow #4087
Merged
1 of 6 tasks
@seisman seisman removed this from Pythonic GMT arguments Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@yvonnefroehlich yvonnefroehlich yvonnefroehlich left review comments
Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@michaelgrund michaelgrund michaelgrund approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@seisman seisman

Labels

enhancement Improving an existing feature

Projects

None yet

Milestone

0.17.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@seisman @michaelgrund @yvonnefroehlich
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.