Skip to content

Commit

Permalink
feat: Use 'method' arg for jax.numpy.percentile
Browse files Browse the repository at this point in the history
* Change the argument name in jax.numpy.percentile from 'interpolation' to 'method'.
  No change to the lower bounds on jax and jaxlib is required as 'method' already
  existed as an argument in jax v0.4.1. This just deprecates the use of 'interpolation'.
   - Avoids the following DeprecationWarning in jax v0.4.29+:

     DeprecationWarning: The interpolation= argument to 'percentile' is deprecated.
     Use 'method=' instead.
   - c.f. https://github.com/google/jax/pull/ 21267
  • Loading branch information
matthewfeickert committed Jun 20, 2024
1 parent 997e5e5 commit 0497f50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pyhf/tensor/jax_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def percentile(self, tensor_in, q, axis=None, interpolation="linear"):
.. versionadded:: 0.7.0
"""
return jnp.percentile(tensor_in, q, axis=axis, interpolation=interpolation)
return jnp.percentile(tensor_in, q, axis=axis, method=interpolation)

def stack(self, sequence, axis=0):
return jnp.stack(sequence, axis=axis)
Expand Down

0 comments on commit 0497f50

Please sign in to comment.