Skip to content

Conversation

@willschlitzer
Copy link
Contributor

@willschlitzer willschlitzer commented Jan 10, 2026

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.
@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
spacing=5,
statistic="quantile",
quantile_value=75,
quantile_value="75",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
quantile_value="75",
quantile_value=75,

npt.assert_allclose(temp_grid.mean(), 4227489)


def test_binstats_quantile_range_validation():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please merge the two tests into one function test_binstats_quantile_value.

@seisman seisman added this to the 0.19.0 milestone Jan 14, 2026
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