Skip to content

Commit

Permalink
Merge pull request #109 from freegs-plasma/fix-scipy
Browse files Browse the repository at this point in the history
Fix use of deprecated scipy function
  • Loading branch information
ZedThree authored Jun 25, 2024
2 parents 82081a7 + c3f7e00 commit 1482181
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 1482181

Please sign in to comment.