Skip to content

Commit 79cf828

Browse files
committed
compute dask array before np array equal (OSOceanAcoustics#1452)
1 parent 9f1a1f7 commit 79cf828

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

echopype/tests/calibrate/test_env_params.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ def test_harmonize_env_param_time():
103103
p_new = harmonize_env_param_time(p=p, ping_time=ping_time_target)
104104
assert (p_new["ping_time"] == ping_time_target).all()
105105
assert isinstance(p_new.data, dask.array.Array)
106-
# np.array_equal() computes dask array under the hood
107-
assert np.array_equal(p_new.data, p.data)
106+
# We must compute dask array or else we will get the warning:
107+
# Warning: The `numpy.array_equal` function is not implemented by Dask array.
108+
assert np.array_equal(p_new.data.compute(), p.data.compute())
108109

109110
# ping_time target requires actual interpolation
110111
ping_time_target = xr.DataArray(

0 commit comments

Comments
 (0)