Fix: Replace deprecated np.bool with np.bool_ for NumPy 2.0 compatibi…#1
Merged
Conversation
…lity 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+.
Contributor
|
Thanks for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…lity
Fix NumPy 2.0 compatibility: replace deprecated np.bool with np.bool_
Replace the deprecated
np.boolalias withnp.bool_to ensure compatibility with NumPy 2.0+. Thenp.boolalias was deprecated in NumPy 1.20 and removed in NumPy 2.0.Changes:
npt.NDArray[np.bool]tonpt.NDArray[np.bool_]np.booltonp.bool_This fixes the AttributeError: module 'numpy' has no attribute 'bool' that occurred when importing the module with NumPy 2.0+.