Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize Xarray datasets to Dask arrays #4756

merged 1 commit into from Apr 30, 2019


Copy link

@mrocklin mrocklin commented Apr 30, 2019

Fixes #4532

  • Tests added / passed
  • Passes flake8 dask

cc @mraspaud @shoyer if you have time to take a look at this I would appreciate it.

shoyer approved these changes Apr 30, 2019
Copy link

@shoyer shoyer left a comment

Thanks, this looks like the right way to handle xarray objects in dask. (Short of a more generic numpy duck-typing protocol that we could use instead)

def test_xarray():
y = da.mean(xr.DataArray([1, 2, 3.0]))

assert_eq(y, y)
Copy link

@shoyer shoyer Apr 30, 2019

does this verify that the type of the result is a dask array? assert isinstance(y, da.Array) might be a more direct way to do this.

Copy link
Member Author

@mrocklin mrocklin Apr 30, 2019

Well, I could imagine future behavior being that the result here is an Xarray thing rather than a Dask thing. I actually don't care too much about the output, as long as it computes and is self-consistent.

Copy link

@jcrist jcrist commented Apr 30, 2019

LGTM, merging.

@jcrist jcrist merged commit 5f69afe into dask:master Apr 30, 2019
2 checks passed
@jcrist jcrist deleted the xarray-normalize branch Apr 30, 2019
jorge-pessoa pushed a commit to jorge-pessoa/dask that referenced this issue May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants