Skip to content

Commit

Permalink
remove deprecated cumtrapz calls
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmyhill committed Jul 4, 2024
1 parent 26d9048 commit 793d8d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 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,7 @@ 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 793d8d9

Please sign in to comment.