Skip to content

Conversation

@lsabor
Copy link
Contributor

@lsabor lsabor commented Dec 7, 2025

No description provided.

Copy link
Contributor

Copilot AI left a 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 attempts to re-add a check for unchanging values by modifying the validation condition from > to >= on line 60. However, this change introduces a critical bug that breaks existing functionality for handling repeating values in numeric distributions.

Key Issue:

  • The validation change rejects equal consecutive values before they can be processed by the _check_and_update_repeating_values method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if percentiles[i].percentile >= percentiles[i + 1].percentile:
raise ValueError("Percentiles must be in strictly increasing order")
if percentiles[i].value > percentiles[i + 1].value:
if percentiles[i].value >= percentiles[i + 1].value:
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

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

This change breaks the handling of repeating values. The validation now rejects equal values with >=, but the _check_and_update_repeating_values method (called on line 81) is specifically designed to handle and modify repeating values at bounds. With this change, repeating values will be rejected before they can be processed, causing the tests test_valid_repeating_values_at_lower_bound and test_valid_repeating_values_at_upper_bound to fail.

If the intention is to truly reject all equal values, then the _check_and_update_repeating_values method should be removed. Otherwise, this validation should remain as > to allow repeating values to be processed by the update method.

Suggested change
if percentiles[i].value >= percentiles[i + 1].value:
if percentiles[i].value > percentiles[i + 1].value:

Copilot uses AI. Check for mistakes.
@lsabor lsabor changed the title re-add check for unchanging values add more robust solution for _check_and_update_repeating_values Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants