Skip to content

Commit

Permalink
Merge branch 'gc_allow_dataarray' of https://github.com/mathause/mesmer
Browse files Browse the repository at this point in the history
… into gc_allow_dataarray
  • Loading branch information
mathause committed Sep 21, 2023
2 parents 85d4346 + 179e1ea commit 76d9914
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 1 addition & 2 deletions mesmer/core/computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def gaspari_cohn(r):
Returns
-------
out : xr.DataArray
out : xr.DataArray, , np.array
Gaspari-Cohn correlation function
Notes
Expand Down Expand Up @@ -49,7 +49,6 @@ def gaspari_cohn(r):
return _gaspari_cohn_np(r)

out = _gaspari_cohn_np(r.values)

out = xr.DataArray(out, dims=r.dims, coords=r.coords, attrs=r.attrs)

return out
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/test_computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ def test_gaspari_cohn():

expected = np.array([0.68489583, 1.0, 0.68489583, 0.20833333, 0.01649306, 0.0])
expected = expected.reshape(2, 3)

expected = xr.DataArray(expected, dims=dims, coords=coords, attrs=attrs)

xr.testing.assert_allclose(expected, result, rtol=1e-6)

assert result.attrs == attrs


Expand Down

0 comments on commit 76d9914

Please sign in to comment.