Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace scipy.integrate.simps which has been removed in favor of simpson #2119

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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