Skip to content

Commit

Permalink
replace deprecated scipy.integrate.simps with simpson
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyStegeman committed Jun 26, 2024
1 parent 028fe1f commit cf5e384
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions validphys2/src/validphys/arclength.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Module for the computation and presentation of arclengths.
"""

from collections import namedtuple
from collections.abc import Sequence
import numbers
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit cf5e384

Please sign in to comment.