[yt-svn] commit/yt: ngoldbaum: Explicitly check is an operation uses np.number during binary operations.
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu May 22 13:38:20 PDT 2014
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/89068196ae22/
Changeset: 89068196ae22
Branch: yt-3.0
User: ngoldbaum
Date: 2014-05-22 22:31:46
Summary: Explicitly check is an operation uses np.number during binary operations.
Fixes #845
Affected #: 1 file
diff -r 83b72f64df4676f00cfc3b23f57d6317c86e10f5 -r 89068196ae22b86b7b5e898b2c5337af8f216bed yt/units/yt_array.py
--- a/yt/units/yt_array.py
+++ b/yt/units/yt_array.py
@@ -1029,9 +1029,9 @@
def get_binary_op_return_class(cls1, cls2):
if cls1 is cls2:
return cls1
- if cls1 is np.ndarray or issubclass(cls1, numeric_type):
+ if cls1 is np.ndarray or issubclass(cls1, (numeric_type, np.number)):
return cls2
- if cls2 is np.ndarray or issubclass(cls2, numeric_type):
+ if cls2 is np.ndarray or issubclass(cls2, (numeric_type, np.number)):
return cls1
if issubclass(cls1, YTQuantity):
return cls2
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list