Skip to content

Add amin/amax aliases to min/max in dask array - #5032

Closed
mrocklin wants to merge 2 commits into
dask:masterfrom
mrocklin:amin
Closed

mrocklin wants to merge 2 commits into
dask:masterfrom
mrocklin:amin

Conversation

@mrocklin

@mrocklin mrocklin commented Jul 1, 2019

Copy link
Copy Markdown
Member

Fixes #5031

@pentschev

Copy link
Copy Markdown
Member

Thanks @mrocklin, was going to suggest the same thing.

@shoyer

shoyer commented Jul 1, 2019

Copy link
Copy Markdown
Member

I would add an alias for dask.array.round_, too. It will have the same issue, as noted in numpy/numpy#13877.

@rgommers

rgommers commented Jul 1, 2019

Copy link
Copy Markdown
Contributor

This is the easiest fix, but I don't think it's the right one. Using the dict approach as discussed in gh-5031 is much nicer, solves the issue too and does not pollute the dask.array namespace with aliases that you don't really want.

@mrocklin

mrocklin commented Jul 1, 2019

Copy link
Copy Markdown
Member Author

Any interest in submitting an alternative @rgommers ?

@rgommers

rgommers commented Jul 1, 2019

Copy link
Copy Markdown
Contributor

Let me give it a try tonight. If anyone else was working on it already, please comment.

@rgommers

rgommers commented Jul 2, 2019

Copy link
Copy Markdown
Contributor

Any interest in submitting an alternative @rgommers ?

Okay first cut in gh-5043.

@shoyer

shoyer commented Jul 2, 2019

Copy link
Copy Markdown
Member

I would lean towards submitting this first, even if we also go for @rgommers's approach, too (which will be a bit more involved).

@rgommers

rgommers commented Jul 2, 2019

Copy link
Copy Markdown
Contributor

I would lean towards submitting this first, even if we also go for @rgommers's approach, too (which will be a bit more involved).

That's only helpful for skimage in case you stick this in a release right? And at that point you can't remove it easily anymore. Why not just make a decision? - my PR probably takes half a day to finish up.

@mrocklin

mrocklin commented Jul 2, 2019

Copy link
Copy Markdown
Member Author

I'm happy to defer to folks like @shoyer and @pentschev here on which to choose. I'll admit a very slight preference for the solution here, just for the sake of simplicity.

@rgommers

rgommers commented Jul 2, 2019

Copy link
Copy Markdown
Contributor

@mrocklin note that this doesn't actually fix all the problems, e.g. np.median(dask_array) still goes from working fine with numpy 1.16 to raising an uninformative TypeError with 1.17.

I agree it's simpler, and if it was just about extra namespace aliases then that's a taste thing. But Array.__array_function__ needs a tweak either way.

Also, if you do decide to merge this, the regression tests in gh-5043 would be good to take over here.

@jakirkham jakirkham added the array label Jul 2, 2019
@pentschev

Copy link
Copy Markdown
Member

I have no major objections either way. The only concern I have is with array creation https://github.com/dask/dask/pull/5043/files#diff-0dc21516366e88095fc3dbf2e9e62f9aR4584. As far as I understand, this would prevent dispatching to libraries like CuPy.

@rgommers

rgommers commented Jul 2, 2019

Copy link
Copy Markdown
Contributor

The only concern I have is with array creation https://github.com/dask/dask/pull/5043/files#diff-0dc21516366e88095fc3dbf2e9e62f9aR4584. As far as I understand, this would prevent dispatching to libraries like CuPy.

I'll move that comment to that actual line. I don't think it's an issue, but let's discuss there.

@mrocklin mrocklin closed this Jul 5, 2019
@mrocklin
mrocklin deleted the amin branch July 5, 2019 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dask array failing with numpy 1.17.0rc1 and np.min

5 participants