Skip to content
Snippets Groups Projects

Fix: `np.issctype` was removed in NumPy 2.0. Use `issubdtype(_, np.generic)` instead.

Merged Frederik Hennig requested to merge da15siwa/pystencils:fix-numpy into master
Compare and
1 file
+ 1
1
Preferences
Compare changes
@@ -7,7 +7,7 @@ import sympy as sp
def is_supported_type(dtype: np.dtype):
scalar = dtype.type
c = np.issctype(dtype)
c = np.issubdtype(dtype, np.generic)
subclass = issubclass(scalar, np.floating) or issubclass(scalar, np.integer) or issubclass(scalar, np.bool_)
additional_checks = dtype.fields is None and dtype.hasobject is False and dtype.subdtype is None
return c and subclass and additional_checks