Skip to content

Commit

Permalink
Fix use of deprecated scipy functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedThree committed Jun 25, 2024
1 parent cc9dc61 commit ae5bbff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/fusiondls/Analytic_DLS.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
from scipy import interpolate
from scipy.integrate import quad, trapz
from scipy.integrate import quad, trapezoid

from .AnalyticCoolingCurves import LfuncN

Expand Down Expand Up @@ -42,7 +42,7 @@ def CfInt(spar, B_field, sx, L, sh=0, kappa1=2500):
T = np.linspace(0, 100, 1000)
for t in T:
Q.append(LfuncN(t))
C0 = (2 * kappa1 * trapz(Q * T ** (1 / 2), T)) ** (-1 / 2)
C0 = (2 * kappa1 * trapezoid(Q * T ** (1 / 2), T)) ** (-1 / 2)
Cf = Cf * C0
return Cf

Expand Down
4 changes: 2 additions & 2 deletions src/fusiondls/LRBv21.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import numpy as np
from scipy import interpolate
from scipy.integrate import cumtrapz
from scipy.integrate import cumulative_trapezoid

from .DLScommonTools import pad_profile
from .Iterate import iterate
Expand Down Expand Up @@ -341,7 +341,7 @@ def LRBv21(
) # Initial upstream pressure in Pa, calculated so it can be kept constant if required

# Cooling curve integral
Lint = cumtrapz(si.Lz[1] * np.sqrt(si.Lz[0]), si.Lz[0], initial=0)
Lint = cumulative_trapezoid(si.Lz[1] * np.sqrt(si.Lz[0]), si.Lz[0], initial=0)
integralinterp = interpolate.interp1d(si.Lz[0], Lint)

# Guesses/initialisations for control variables assuming qpll0 everywhere and qpll=0 at target
Expand Down

0 comments on commit ae5bbff

Please sign in to comment.