Skip to content

Commit

Permalink
Merge pull request #550 from kyleaoman/enable_subclass_unyt_quantity
Browse files Browse the repository at this point in the history
BUG: strictly checking type hinders subclassing
  • Loading branch information
neutrinoceros authored Dec 20, 2024
2 parents e8718fc + 54ed732 commit 41b4b36
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 41b4b36

Please sign in to comment.