We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a93a68 commit ad11d3aCopy full SHA for ad11d3a
pint/facets/numpy/numpy_func.py
@@ -52,6 +52,10 @@ def _is_sequence_with_quantity_elements(obj):
52
-------
53
True if obj is a sequence and at least one element is a Quantity; False otherwise
54
"""
55
+ if np is not None and isinstance(obj, np.ndarray) and not obj.dtype.hasobject:
56
+ # If obj is a numpy array, avoid looping on all elements
57
+ # if dtype does not have objects
58
+ return False
59
return (
60
iterable(obj)
61
and sized(obj)
0 commit comments