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

Fix use of deprecated scipy function #109

Merged
merged 1 commit into from
Jun 25, 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
4 changes: 2 additions & 2 deletions freegs/equilibrium.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from numpy import pi, meshgrid, linspace, exp, array
import numpy as np
from scipy import interpolate
from scipy.integrate import romb, cumtrapz # Romberg integration
from scipy.integrate import romb, cumulative_trapezoid

from .boundary import fixedBoundary, freeBoundary
from . import critical
Expand Down Expand Up @@ -374,7 +374,7 @@ def tor_flux(self, psi=None):
qvals = self.q(psiN)

# Integrate q wrt psi to get rho. rho = 0 @ psiN = 0
result = cumtrapz(qvals, psi, initial=0.0) * (-1.0 / (2.0 * np.pi))
result = cumulative_trapezoid(qvals, psi, initial=0.0) * (-1.0 / (2.0 * np.pi))

# Convert to a scalar if only one result
if len(result) == 1:
Expand Down
Loading