Skip to content
Snippets Groups Projects
Commit 6f59ff9f authored by Kaushik Kulkarni's avatar Kaushik Kulkarni Committed by Andreas Klöckner
Browse files

ArrayContainer fixes for numpy arrays as leaf classes

parent 5bf46bc6
No related branches found
No related tags found
No related merge requests found
...@@ -218,7 +218,11 @@ def is_array_container(ary: Any) -> bool: ...@@ -218,7 +218,11 @@ def is_array_container(ary: Any) -> bool:
"cheaper option, see is_array_container_type.", "cheaper option, see is_array_container_type.",
DeprecationWarning, stacklevel=2) DeprecationWarning, stacklevel=2)
return (serialize_container.dispatch(ary.__class__) return (serialize_container.dispatch(ary.__class__)
is not serialize_container.__wrapped__) # type:ignore[attr-defined] is not serialize_container.__wrapped__ # type:ignore[attr-defined]
# numpy values with scalar elements aren't array containers
and not (isinstance(ary, np.ndarray)
and ary.dtype.kind != "O")
)
@singledispatch @singledispatch
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment