Skip to content

pygmt.binstats: Validate the quantile_value parameter#4332

Merged
seisman merged 11 commits into
GenericMappingTools:mainfrom
willschlitzer:quantile_value_check
Jan 16, 2026
Merged

pygmt.binstats: Validate the quantile_value parameter#4332
seisman merged 11 commits into
GenericMappingTools:mainfrom
willschlitzer:quantile_value_check

Conversation

@willschlitzer

@willschlitzer willschlitzer commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

Description of proposed changes

This adds input validation for quantile_value, specifically that it is a number, and that it is between 0 and 100. It also adds testing for this input validations, including modifying test_binstats_quantile() to pass a numeric value as a string.

This commit adds input validation for quantile value, specifically that it is a number, and that it is between 0 and 100.
It also adds testing for these changes, including modifying test_binstats_quantile() to pass a numeric value as a string.
Comment thread pygmt/src/binstats.py Outdated
Comment thread pygmt/src/binstats.py Outdated
@seisman seisman changed the title Add input validation for quantile_value in binstats.py. pygmt.binstats: Validate the quantile_value parameter Jan 11, 2026
@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog labels Jan 11, 2026
willschlitzer and others added 2 commits January 13, 2026 05:09
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Comment thread pygmt/tests/test_binstats.py Outdated
Comment thread pygmt/tests/test_binstats.py Outdated
@seisman seisman added this to the 0.19.0 milestone Jan 14, 2026
willschlitzer and others added 3 commits January 14, 2026 14:47
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
This updates the input validation to use separate error messages depending on the quantile_value input. Additionally, it combines two tests by parametrizes the invalid input values.
Comment thread pygmt/src/binstats.py Outdated
willschlitzer and others added 2 commits January 15, 2026 09:07
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
…e_value input validation in test_binstats.py

Modify the pytest parametrize decorator to include both an error type and invalid quantile_value input to test for the different error types in conjunction with the invalid input.
Comment thread pygmt/tests/test_binstats.py Outdated
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
@seisman

seisman commented Jan 16, 2026

Copy link
Copy Markdown
Member

/format

@seisman seisman added the final review call This PR requires final review and approval from a second reviewer label Jan 16, 2026
Comment thread pygmt/tests/test_binstats.py Outdated
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Jan 16, 2026
@seisman seisman merged commit 1a2d806 into GenericMappingTools:main Jan 16, 2026
18 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants