From 953155d585b60c69f757f6e7861981d60bd0036b Mon Sep 17 00:00:00 2001 From: Stephan Kuschel Date: Mon, 8 Jul 2024 23:09:15 +0200 Subject: [PATCH] scipy 1.14.0 has removed deprecated functions upate the code accordingly --- postpic/datahandling.py | 4 ++-- test/test_datahandling.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/postpic/datahandling.py b/postpic/datahandling.py index 6d63a53..0b1b9a8 100644 --- a/postpic/datahandling.py +++ b/postpic/datahandling.py @@ -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] @@ -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. diff --git a/test/test_datahandling.py b/test/test_datahandling.py index e0428a9..bbdb25b 100755 --- a/test/test_datahandling.py +++ b/test/test_datahandling.py @@ -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))