Skip to content

Commit

Permalink
Merge pull request #597 from bobmyhill/rm_cumtrapz
Browse files Browse the repository at this point in the history
remove deprecated cumtrapz call
  • Loading branch information
bobmyhill authored Jul 4, 2024
2 parents 26d9048 + 55b4b54 commit 7b89822
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions burnman/classes/seismic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:]
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion burnman/utils/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 7b89822

Please sign in to comment.