From 3a78f5380c194e49659ddc59b2eb70b9f835801b Mon Sep 17 00:00:00 2001 From: Longtsing Date: Thu, 6 Nov 2025 13:24:49 +0800 Subject: [PATCH] Fix: Replace deprecated np.bool with np.bool_ for NumPy 2.0 compatibility Fix NumPy 2.0 compatibility: replace deprecated np.bool with np.bool_ Replace the deprecated `np.bool` alias with `np.bool_` to ensure compatibility with NumPy 2.0+. The `np.bool` alias was deprecated in NumPy 1.20 and removed in NumPy 2.0. Changes: - Line 66: Update type annotation from `npt.NDArray[np.bool]` to `npt.NDArray[np.bool_]` - Line 71: Update dtype comparison from `np.bool` to `np.bool_` This fixes the AttributeError: module 'numpy' has no attribute 'bool' that occurred when importing the module with NumPy 2.0+. --- ceilopyter/noise.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ceilopyter/noise.py b/ceilopyter/noise.py index cba329c..a7a26a7 100644 --- a/ceilopyter/noise.py +++ b/ceilopyter/noise.py @@ -5,7 +5,7 @@ def remove_noise( beta_uncorr: npt.NDArray[np.floating], noise_floor: float, snr_limit: float = 5 -) -> npt.NDArray[np.bool]: +) -> npt.NDArray[np.bool_]: zero_ranges = np.all(beta_uncorr == 0, axis=0) n_zeros = np.argmax(~zero_ranges[::-1])