From cf5e384ae745f5f67cc73d6fff5b4f7e18b25a58 Mon Sep 17 00:00:00 2001 From: RoyStegeman Date: Wed, 26 Jun 2024 10:58:31 +0100 Subject: [PATCH] replace deprecated scipy.integrate.simps with simpson --- validphys2/src/validphys/arclength.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/validphys2/src/validphys/arclength.py b/validphys2/src/validphys/arclength.py index 88169ae77b..48258f52d3 100644 --- a/validphys2/src/validphys/arclength.py +++ b/validphys2/src/validphys/arclength.py @@ -3,6 +3,7 @@ Module for the computation and presentation of arclengths. """ + from collections import namedtuple from collections.abc import Sequence import numbers @@ -78,7 +79,7 @@ def arc_lengths( # PDFs evaluated on grid, use the entire thing, the Stats class will chose later xfgrid = xplotting_grid(pdf, Q, ixgrid, basis, flavours).grid_values.data * ixgrid[1] fdiff = np.diff(xfgrid) / eps # Compute forward differences - res += integrate.simps(np.sqrt(1 + np.square(fdiff)), ixgrid[1][1:]) + res += integrate.simpson(np.sqrt(1 + np.square(fdiff)), x=ixgrid[1][1:]) stats = pdf.stats_class(res) return ArcLengthGrid(pdf, basis, flavours, stats) @@ -150,7 +151,7 @@ def integrability_number( basis: (str, Basis) = "evolution", flavours: (list, tuple, type(None)) = None, ): - """Return \sum_i |x_i*f(x_i)|, x_i = {1e-9, 1e-8, 1e-7} + r"""Return \sum_i |x_i*f(x_i)|, x_i = {1e-9, 1e-8, 1e-7} for selected flavours """ checked = check_basis(basis, flavours)