From 55b4b5400fd5cd5cb9ca2a05e380150b96e4a97e Mon Sep 17 00:00:00 2001 From: Bob Myhill Date: Thu, 4 Jul 2024 17:27:07 +0100 Subject: [PATCH] remove deprecated cumtrapz calls --- burnman/classes/seismic.py | 6 ++++-- burnman/utils/math.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/burnman/classes/seismic.py b/burnman/classes/seismic.py index f4f32b6f4..4fa833fc1 100644 --- a/burnman/classes/seismic.py +++ b/burnman/classes/seismic.py @@ -312,7 +312,7 @@ def _compute_gravity(self): if len(density) > 0: radii = self.table_radius[::-1] - g = scipy.integrate.cumtrapz( + g = scipy.integrate.cumulative_trapezoid( constants.G * 4.0 * np.pi * density * radii * radii, x=radii, initial=0 ) g[1:] = g[1:] / radii[1:] / radii[1:] @@ -332,7 +332,9 @@ def _compute_pressure(self): # convert radii to depths depth = self.earth_radius - radii - pressure = scipy.integrate.cumtrapz(gravity * density, x=depth, initial=0.0) + pressure = scipy.integrate.cumulative_trapezoid( + gravity * density, x=depth, initial=0.0 + ) self.table_pressure = pressure diff --git a/burnman/utils/math.py b/burnman/utils/math.py index d142646de..312c788a8 100644 --- a/burnman/utils/math.py +++ b/burnman/utils/math.py @@ -413,7 +413,7 @@ def l2(x, funca, funcb): diff = np.array(funca - funcb) diff = diff * diff - return integrate.trapz(diff, x) + return integrate.trapezoid(diff, x) def nrmse(x, funca, funcb):