From 72f47d673b5366e07338bc3bf6394ef1902f9a7f Mon Sep 17 00:00:00 2001 From: Matthew McCormick Date: Mon, 16 Jun 2025 14:04:51 -0400 Subject: [PATCH] COMP: Replace np.bool with np.bool_ 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 --- Wrapping/Generators/Python/itk/support/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Wrapping/Generators/Python/itk/support/types.py b/Wrapping/Generators/Python/itk/support/types.py index 7ccfd045370..1cc82850594 100644 --- a/Wrapping/Generators/Python/itk/support/types.py +++ b/Wrapping/Generators/Python/itk/support/types.py @@ -140,7 +140,7 @@ def initialize_c_types_once() -> ( _SS: "itkCType" = itkCType("signed short", "SS", np.dtype(np.int16)) _SI: "itkCType" = itkCType("signed int", "SI", np.dtype(np.int32)) _SLL: "itkCType" = itkCType("signed long long", "SLL", np.dtype(np.int64)) - _B: "itkCType" = itkCType("bool", "B", np.dtype(np.bool)) + _B: "itkCType" = itkCType("bool", "B", np.dtype(np.bool_)) return _F, _D, _UC, _US, _UI, _UL, _SL, _LD, _ULL, _SC, _SS, _SI, _SLL, _B