Skip to content

Commit dc918fe

Browse files
return NotImplemted for unsupported operations in __array_ufunc__
1 parent 6acfa57 commit dc918fe

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tunits/core/cython/with_unit_value_array.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class ValueArray(WithUnit):
133133
if self._is_dimensionless():
134134
return getattr(ufunc, method)(*(np.asarray(x) for x in inputs), **kwargs)
135135

136-
raise NotImplemented
136+
return NotImplemented
137137

138138
@property
139139
def dtype(WithUnit self) -> np.dtype:
@@ -160,4 +160,4 @@ class ValueArray(WithUnit):
160160
def to_proto(self, msg: Optional['tunits_pb2.ValueArray'] = None) -> 'tunits_pb2.ValueArray':
161161
ret = _ndarray_to_proto(self.value, msg)
162162
ret.units.extend(_units_to_proto(self.display_units))
163-
return ret
163+
return ret

0 commit comments

Comments
 (0)