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

xarray.dot is now based on da.einsum #2089

Merged
merged 5 commits into from May 4, 2018
Merged

Conversation

crusaderky
Copy link
Contributor

@crusaderky crusaderky commented Apr 27, 2018

Closes #2074
Requires dask >= 0.17.3

# subscripts should be passed to np.einsum as arg, not as kwargs. We need
# to construct a partial function for parallelized computation.
func = functools.partial(np.einsum, subscripts)
# to construct a partial function for apply_ufunc to work.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we explicitly raise an informative error (maybe NotImplementedError) if any inputs are wrapping dask arrays and the version of dask is too old? Or maybe we could put that in duck_array_ops.einsum?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

E               AttributeError: module 'dask.array' has no attribute 'einsum': requires dask >=0.17.3

@shoyer shoyer mentioned this pull request May 2, 2018
@shoyer
Copy link
Member

shoyer commented May 2, 2018

It looks like the dot tests are now failing on test_dot because they don't find the right version of dask -- which makes sense because dask hasn't made the 0.17.3 release yet.

Let's wait until that happens (hopefully very soon: dask/dask#3452) before merging this. But we should also add a conditional version check for test_dot with dask. Something like:

        if LooseVersion(dask.__version__) < LooseVersion('0.17.3'):
            pytest.skip("needs dask.array.einsum")

(The appveyor failures should be fixed if you merge in master.)

@crusaderky
Copy link
Contributor Author

@shoyer integrated your suggestion

@shoyer shoyer merged commit 98373f0 into pydata:master May 4, 2018
@shoyer
Copy link
Member

shoyer commented May 4, 2018

thanks @crusaderky !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants