From dfaf567f18b36c1556f326033bb1d2b66f51c4e9 Mon Sep 17 00:00:00 2001 From: Muhammad Yousaf Date: Wed, 30 Oct 2024 12:16:51 +0300 Subject: [PATCH] Fixed deprecated np.float issue by replacing with float to ensure compatibility with latest NumPy versions. NumPy 1.20 (release notes) deprecated numpy.float, numpy.int, and similar aliases, causing them to issue a deprecation warning NumPy 1.24 (release notes) removed these aliases altogether, causing an error when they are used For more details, follow the link: https://stackoverflow.com/questions/74844262/how-can-i-solve-error-module-numpy-has-no-attribute-float-in-python --- pytides/tide.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytides/tide.py b/pytides/tide.py index bc7089c..9d2c3cc 100644 --- a/pytides/tide.py +++ b/pytides/tide.py @@ -235,7 +235,7 @@ def _partition(hours, partition = 3600.0): """ partition = float(partition) relative = hours - hours[0] - total_partitions = np.ceil(relative[-1] / partition + 10*np.finfo(np.float).eps).astype('int') + total_partitions = np.ceil(relative[-1] / partition + 10*np.finfo(float).eps).astype('int') return [hours[np.floor(np.divide(relative, partition)) == i] for i in range(total_partitions)] @staticmethod