Fix misleading error message for coordinate validation#12
Merged
kylecarow merged 1 commit intoNatLabRockies:mainfrom Jan 30, 2026
Merged
Fix misleading error message for coordinate validation#12kylecarow merged 1 commit intoNatLabRockies:mainfrom
kylecarow merged 1 commit intoNatLabRockies:mainfrom
Conversation
Collaborator
|
Thanks for the PR @meredithdoan! I'll go ahead and merge this. If anyone in the future has feelings about changing the comparison to be |
Collaborator
|
@meredithdoan I've published these changes in v0.8.2! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The error message for
Monotonicity(usize)claims that coordinates must be "sorted and non-repeating," but the actual implementation only checks for monotonically increasing values (using<=), which allows duplicate/repeating values. This makes the error message deceptive - it promises stricter validation than is actually performed.An alternative fix would be to change the implementation to use < instead of <=, enforcing strictly increasing coordinates (no duplicates). See https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.PchipInterpolator.html: SciPy's interpolation functions explicitly reject duplicate values as they would make the function "overspecified." However, changing the implementation to require strictly increasing coordinates would be a breaking change and may affect existing users. This PR opts for the minimal fix of correcting the error message to match the current behavior.