Skip to content

Commit

Permalink
Check for subclass of unyt_quantity instead of exact matching type.
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleaoman committed Dec 19, 2024
1 parent e8718fc commit 54ed732
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unyt/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,7 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
elif out_arr.size == 1:
out_arr = unyt_array(np.asarray(out_arr), unit)
else:
if ret_class is unyt_quantity:
if issubclass(ret_class, unyt_quantity):
# This happens if you do ndarray * unyt_quantity.
# Explicitly casting to unyt_array avoids creating a
# unyt_quantity with size > 1
Expand Down

0 comments on commit 54ed732

Please sign in to comment.