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
merged 1 commit into from Apr 30, 2019

Conversation

Projects
None yet
3 participants
@mrocklin
Copy link
Member

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

shoyer approved these changes Apr 30, 2019

Copy link
Member

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)

This comment has been minimized.

Copy link
@shoyer

shoyer Apr 30, 2019

Member

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.

This comment has been minimized.

Copy link
@mrocklin

mrocklin Apr 30, 2019

Author Member

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.

@jcrist

This comment has been minimized.

Copy link
Member

commented Apr 30, 2019

LGTM, merging.

@jcrist jcrist merged commit 5f69afe into dask:master Apr 30, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jcrist jcrist deleted the mrocklin:xarray-normalize branch Apr 30, 2019

jorge-pessoa pushed a commit to jorge-pessoa/dask that referenced this pull request May 14, 2019

Thomas-Z added a commit to Thomas-Z/dask that referenced this pull request May 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.