From d6838c5b89240dcae9c503c7da1ba01c0eaf256f Mon Sep 17 00:00:00 2001 From: Alessandro Gagliardi <114491917+alexgag11@users.noreply.github.com> Date: Fri, 27 Jun 2025 22:45:39 +0200 Subject: [PATCH] Update ptp function call Update ptp function call. Since NumPy 2.0, the function ptp is no longer a method of the class numpy.ndarray --- ipart/utils/funcs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipart/utils/funcs.py b/ipart/utils/funcs.py index ba4fbd4..5984118 100644 --- a/ipart/utils/funcs.py +++ b/ipart/utils/funcs.py @@ -1185,7 +1185,7 @@ def dLatitude(lats, lons, R=6371000, verbose=True): #---------Get axes and bounds------------------- latax_bounds=getBounds(lats) - delta_y=latax_bounds.ptp(axis=1)*np.pi/180.*R + delta_y=np.ptp(latax_bounds,axis=1)*np.pi/180.*R #-------Repeat array to get slab--------------- delta_y=np.repeat(delta_y[:,None],len(lons),axis=1) @@ -1593,7 +1593,7 @@ def signedArea(x, y): y=np.asarray(y) def isClosed(xs,ys): if np.alltrue([np.allclose(xs[0],xs[-1]),\ - np.allclose(ys[0],ys[-1]),xs.ptp(),ys.ptp()]): + np.allclose(ys[0],ys[-1]),np.ptp(xs),np.ptp(ys)]): return True else: return False