Skip to content

Commit 77ec56b

Browse files
fix dimensionless
1 parent f32d779 commit 77ec56b

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

test/test_value_array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_dimensionless_act_like_arrays() -> None:
8787
y = ValueArray(1.5 * np.arange(5), 'us/ns')
8888

8989
np.testing.assert_allclose(np.sqrt(x), np.sqrt(1.5 * np.arange(5)))
90-
np.testing.assert_allclose(np.sin(y), np.sin(1.5 * np.arange(5)))
90+
np.testing.assert_allclose(np.sin(y), np.sin(1.5 * np.arange(5) * 1000))
9191

9292

9393
def test_repr() -> None:

tunits/core/cython/with_unit_value_array.pyx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ class ValueArray(WithUnit):
144144
]:
145145
return getattr(ufunc, method)(*(np.asarray(x) for x in inputs), **kwargs)
146146

147+
if self._is_dimensionless():
148+
return getattr(ufunc, method)(*(np.asarray(x) for x in inputs), **kwargs)
149+
147150
raise NotImplemented
148151

149152
@property

0 commit comments

Comments
 (0)