From 99aab6ea86911b3f938e8d0d10cb8679c50815fa Mon Sep 17 00:00:00 2001 From: Shreyansh Jain <131460414+shreyanshjain05@users.noreply.github.com> Date: Tue, 1 Apr 2025 17:12:02 +0530 Subject: [PATCH] Replace deprecated np.alltrue for NumPy 2.0 compatibility The function np.alltrue was deprecated and removed in NumPy 2.0. This commit replaces all instances of np.alltrue with np.all to ensure compatibility with NumPy 2.0 and later versions. The np.all function performs the same check to determine if all elements of an array are True (or meet a given condition). This change addresses the deprecation warning and ensures that the code works with the latest version of NumPy. --- image_dehazer/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/image_dehazer/__init__.py b/image_dehazer/__init__.py index 9c54b81..f4a414e 100644 --- a/image_dehazer/__init__.py +++ b/image_dehazer/__init__.py @@ -257,7 +257,7 @@ def __zero_pad(self, image, shape, position='corner'): shape = np.asarray(shape, dtype=int) imshape = np.asarray(image.shape, dtype=int) - if np.alltrue(imshape == shape): + if np.all(imshape == shape): return image if np.any(shape <= 0): @@ -299,4 +299,4 @@ def remove_haze(HazeImg, airlightEstimation_windowSze=15, boundaryConstraint_win regularize_lambda=regularize_lambda, sigma=sigma, delta=delta, showHazeTransmissionMap=showHazeTransmissionMap) HazeCorrectedImg, HazeTransmissionMap = Dehazer.remove_haze(HazeImg) - return (HazeCorrectedImg, HazeTransmissionMap) \ No newline at end of file + return (HazeCorrectedImg, HazeTransmissionMap)