Skip to content

Commit 2c4ce5e

Browse files
committed
plot_common: use keyword "method" instead of "interpolation"
The `interpolation` keyword has been deprecated since numpy 1.22.0, and is removed in numpy 2.4: <https://numpy.org/doc/stable/release/2.4.0-notes.html#removed-interpolation-parameter-from-quantile-and-percentile-functions>. `method` is its synonymous replacement.
1 parent 23f8535 commit 2c4ce5e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

tornettools/plot_common.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,9 @@ def draw_cdf(axis, data, yscale=None, **kwargs):
204204
d = [getfirstorself(item) for item in data]
205205
y = __calc_cdf_bins(yscale, axis.gca().get_yaxis())
206206

207-
# the 'interpolation' parameter name is deprecated and replaced with
208-
# 'method', but this change is recent so we'll stick with the deprecated
209-
# name for now
210-
# https://numpy.org/doc/stable/reference/generated/numpy.quantile.html
211-
# the 'lower' is used to match the behaviour of 'draw_cdf_ci()' above
212-
# https://github.com/shadow/tornettools/issues/76
213-
x = quantile(d, y, interpolation='lower')
207+
# the method 'lower' is used to match the behaviour of 'draw_cdf_ci()'
208+
# above. See https://github.com/shadow/tornettools/issues/76
209+
x = quantile(d, y, method='lower')
214210

215211
plot_line = axis.plot(x, y, **kwargs)
216212
return plot_line[0]

0 commit comments

Comments
 (0)