Skip to content

Commit

Permalink
scipy 1.14.0 has removed deprecated functions
Browse files Browse the repository at this point in the history
upate the code accordingly
  • Loading branch information
skuschel committed Jul 8, 2024
1 parent bdbafd6 commit 953155d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions postpic/datahandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,7 @@ def _integrate_constant(self, axes):
def _integrate_scipy(self, axes, method):
ret = copy.copy(self)
for axis in reversed(sorted(axes)):
ret._matrix = method(ret, ret.axes[axis].grid, axis=axis)
ret._matrix = method(ret, x=ret.axes[axis].grid, axis=axis)
del ret.axes[axis]
del ret.axes_transform_state[axis]
del ret.transformed_axes_origins[axis]
Expand Down Expand Up @@ -1787,7 +1787,7 @@ def _integrate_fast(self, axes):

return ret

def integrate(self, axes=None, method=scipy.integrate.simps):
def integrate(self, axes=None, method=scipy.integrate.simpson):
'''
Calculates the definite integral along the given axes.
Expand Down
4 changes: 2 additions & 2 deletions test/test_datahandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ def test_integrate(self):
print('type(a.matrix)', type(a.matrix))
self.assertTrue(np.isclose(a, b))

b = self.f2d_fine.integrate(method=scipy.integrate.simps)
c = self.f2d_fine.integrate(method=scipy.integrate.trapz)
b = self.f2d_fine.integrate(method=scipy.integrate.simpson)
c = self.f2d_fine.integrate(method=scipy.integrate.trapezoid)

self.assertTrue(np.isclose(b, 0))
self.assertTrue(np.isclose(c, 0))
Expand Down

0 comments on commit 953155d

Please sign in to comment.