Skip to content

Commit 5690d5b

Browse files
committed
COMP: Replace np.bool with np.bool_
- The alias np.bool was officially deprecated in NumPy 1.20.0.  - The removal (i.e. making np.bool inaccessible / raising AttributeError) occurred in NumPy 1.24.0. As was done upstream in a637501 For: E AttributeError: module 'numpy' has no attribute 'bool'. E `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
1 parent f98d5fa commit 5690d5b

File tree

1 file changed

+1
-1
lines changed
  • Wrapping/Generators/Python/itk/support

1 file changed

+1
-1
lines changed

Wrapping/Generators/Python/itk/support/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def initialize_c_types_once() -> (
140140
_SS: "itkCType" = itkCType("signed short", "SS", np.dtype(np.int16))
141141
_SI: "itkCType" = itkCType("signed int", "SI", np.dtype(np.int32))
142142
_SLL: "itkCType" = itkCType("signed long long", "SLL", np.dtype(np.int64))
143-
_B: "itkCType" = itkCType("bool", "B", np.dtype(np.bool))
143+
_B: "itkCType" = itkCType("bool", "B", np.dtype(np.bool_))
144144
return _F, _D, _UC, _US, _UI, _UL, _SL, _LD, _ULL, _SC, _SS, _SI, _SLL, _B
145145

146146

0 commit comments

Comments
 (0)