Skip to content

Commit 580e3f5

Browse files
committed
Fix arctan2 issue
1 parent 78cb864 commit 580e3f5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/blosc2/ndarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3076,7 +3076,7 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
30763076
if ufunc in ufunc_map:
30773077
value = inputs[0] if inputs[1] is self else inputs[1]
30783078
_check_allowed_dtypes(value)
3079-
return blosc2.LazyExpr(new_op=(value, ufunc_map[ufunc], self))
3079+
return blosc2.LazyExpr(new_op=(inputs[0], ufunc_map[ufunc], inputs[1]))
30803080

30813081
if ufunc in ufunc_map_1param:
30823082
value = inputs[0]

tests/ndarray/test_lazyexpr.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,11 +1550,10 @@ def test_complex_lazy_expression_multiplication():
15501550
theta_np = np.arctan2(Y_b2[:], X_b2[:])
15511551
expected = np.sin(R_np * 4 - time_factor * 2) * np.cos(theta_np * 6)
15521552

1553-
# TODO: for some reason, the result is negative, so we assert against -expected
1554-
np.testing.assert_allclose(result, -expected, rtol=1e-14, atol=1e-14)
1553+
np.testing.assert_allclose(result, expected, rtol=1e-14, atol=1e-14)
15551554

15561555
# Also test getitem access
1557-
np.testing.assert_allclose(result_expr[:], -expected, rtol=1e-14, atol=1e-14)
1556+
np.testing.assert_allclose(result_expr[:], expected, rtol=1e-14, atol=1e-14)
15581557

15591558

15601559
# Test checking that objects following the blosc2.Array protocol can be operated with

0 commit comments

Comments
 (0)