From c3f7e0047001d987706fe8c2d71d63e26598a28d Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Tue, 25 Jun 2024 14:52:49 +0100 Subject: [PATCH] Fix use of deprecated scipy function --- freegs/equilibrium.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freegs/equilibrium.py b/freegs/equilibrium.py index 611f93d..4bf5eeb 100644 --- a/freegs/equilibrium.py +++ b/freegs/equilibrium.py @@ -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 @@ -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: