Closed bschnitzler closed 9 months ago
Sorry for the delayed response -- thanks for finding this! Actually for grid values
that are of type jax.Array
instead of np.ndarray
(the typical use case, at least for me) it seems that JAX's out-of-bounds indexing behavior has been masking the problem and making the buggy jnp.clip
superfluous. Upon reflection, extrapolation probably shouldn't be allowed (or at least should be explicitly controlled by the user) so in addition to fixing the jnp.clip
bounds I've changed the extrapolation behavior to return nan
s in #9.
When trying to interpolate an array over a
Grid
using theinterpolate
method, an error is returned if the interpolation point is beyond the upper bounds.Expected behavior
Extrapolate away the data array to interpolate when point lies outside boundaries
Actual behavior
Raises an
IndexError
Steps to reproduce the behavior
The following example code shows the issue