Reject NaN time knots in interpolation helpers - #780
Open
AHMETHAKANBEZIR1 wants to merge 1 commit into
Open
AHMETHAKANBEZIR1 wants to merge 1 commit into
AHMETHAKANBEZIR1 wants to merge 1 commit into
Conversation
Co-authored-by: OpenAI Codex <codex@openai.com>
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 interpolation preprocessing helpers accept NaN time knots despite requiring monotonically strictly increasing times.
_check_tsrejectsts[:-1] >= ts[1:], but comparisons with NaN return False. For example,linear_interpolation(jnp.array([0., jnp.nan, 2.]), jnp.array([0., jnp.nan, 2.]))propagates invalid values instead of rejecting the time grid.Reject the negation of strict ordering instead. This catches NaN at either side of each adjacent pair while preserving the existing ordering test for non-NaN values. Missing observation values remain supported; the check only applies to the time knots. No API or dependency changes.
Add 36 regression cases across linear_interpolation, rectilinear_interpolation and backward_hermite_coefficients; NaN at the first/middle/last knot; float32/float64; eager and filter_jit.
Validation (Windows CPU, Python3.12.14, JAX0.11.2):
Linux, GPU and documentation build were not run locally.
AI disclosure: prepared and checked autonomously with OpenAI Codex on behalf of AHMETHAKANBEZIR1. No independent human review is claimed.