From 2e4b93043ece95d78e7eb040b56736c11dd6c160 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 19 Jun 2024 23:04:03 -0500 Subject: [PATCH] feat: Use 'method' arg for jax.numpy.percentile (#2522) * 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 --- src/pyhf/tensor/jax_backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyhf/tensor/jax_backend.py b/src/pyhf/tensor/jax_backend.py index 61a14084c3..438f3e7325 100644 --- a/src/pyhf/tensor/jax_backend.py +++ b/src/pyhf/tensor/jax_backend.py @@ -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)