Skip to content

Commit 52f19ca

Browse files
Enable .conjugate on Dask arrays, #10302 (#10303)
Co-authored-by: Jonathan Neuhauser <jonathan.neuhauser@kit.edu> Co-authored-by: Kai Mühlbauer <kai.muehlbauer@uni-bonn.de>
1 parent f20eb7a commit 52f19ca

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

xarray/computation/ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def inplace_to_noninplace_op(f):
283283
# _typed_ops.py uses the following wrapped functions as a kind of unary operator
284284
argsort = _method_wrapper("argsort")
285285
conj = _method_wrapper("conj")
286-
conjugate = _method_wrapper("conjugate")
286+
conjugate = _method_wrapper("conj")
287287
round_ = _func_slash_method_wrapper(duck_array_ops.around, name="round")
288288

289289

xarray/tests/test_dask.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,3 +1822,15 @@ def test_idxmin_chunking():
18221822
actual = da.idxmin("time")
18231823
assert actual.chunksizes == {k: da.chunksizes[k] for k in ["x", "y"]}
18241824
assert_identical(actual, da.compute().idxmin("time"))
1825+
1826+
1827+
def test_conjugate():
1828+
# Test for https://github.com/pydata/xarray/issues/10302
1829+
z = 1j * da.arange(100)
1830+
1831+
data = xr.DataArray(z, coords={"x": np.arange(100)})
1832+
1833+
conj_data = data.conjugate()
1834+
assert dask.is_dask_collection(conj_data)
1835+
1836+
assert_equal(conj_data, data.conj())

0 commit comments

Comments
 (0)