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

np.diagonal implementation #4431

Merged
merged 3 commits into from Feb 19, 2019
Merged

np.diagonal implementation #4431

merged 3 commits into from Feb 19, 2019

Conversation

@horta
Copy link
Contributor

@horta horta commented Jan 28, 2019

  • Tests added / passed
  • Passes flake8 dask

I couldn't make assert sorted(da.diagonal(v).dask) == sorted(da.diagonal(v).dask) work. The calls seems to be deterministic but it cannot sort the graph because tuple and str are not comparable. Shall I just remove it?

I would like to see da.diagonal implemented mainly because of da.trace, which will become easy to implement once this is done.

@horta
Copy link
Contributor Author

@horta horta commented Jan 28, 2019

Checklist: #2911

@mrocklin
Copy link
Member

@mrocklin mrocklin commented Jan 28, 2019

cc @jakirkham , this may interest you

@mrocklin
Copy link
Member

@mrocklin mrocklin commented Jan 30, 2019

@shoyer or @jrbourbeau any interest in reviewing this?

@jrbourbeau
Copy link
Member

@jrbourbeau jrbourbeau commented Jan 31, 2019

Yeah, I'll have some time to look at this tomorrow 👍

@mrocklin
Copy link
Member

@mrocklin mrocklin commented Jan 31, 2019

Copy link
Member

@jrbourbeau jrbourbeau left a comment

Thanks for this PR @horta! I've attached a few comments and questions. In particular, I was wondering about the internal rechunk-ing that would happen for a large input Dask array

dask/array/creation.py Outdated Show resolved Hide resolved
dask/array/creation.py Outdated Show resolved Hide resolved
dask/array/tests/test_creation.py Outdated Show resolved Hide resolved
dask/array/tests/test_creation.py Outdated Show resolved Hide resolved
dask/array/creation.py Outdated Show resolved Hide resolved
dask/array/creation.py Outdated Show resolved Hide resolved
dask/array/creation.py Outdated Show resolved Hide resolved
dask/array/creation.py Outdated Show resolved Hide resolved
@mrocklin
Copy link
Member

@mrocklin mrocklin commented Feb 6, 2019

Checking in on this @horta . Is there any other information you need in order to move forward? It would be great to see this go in.

@horta
Copy link
Contributor Author

@horta horta commented Feb 6, 2019

No need for more information. I will get it going tomorrow!

dask/array/tests/test_creation.py Outdated Show resolved Hide resolved
dask/array/tests/test_creation.py Outdated Show resolved Hide resolved
@horta
Copy link
Contributor Author

@horta horta commented Feb 9, 2019

*working on that

dask/array/creation.py Outdated Show resolved Hide resolved
@jakirkham
Copy link
Member

@jakirkham jakirkham commented Feb 9, 2019

This looks pretty good to me. There are a few comments above, but nothing too difficult I hope.

dask/array/creation.py Outdated Show resolved Hide resolved
dask/array/creation.py Outdated Show resolved Hide resolved
@jakirkham
Copy link
Member

@jakirkham jakirkham commented Feb 13, 2019

This is coming along nicely, @horta. Will give it another look after you have some time to address the remaining comments. Probably one or two tidy up things in the next (last) iteration I think.

dask/array/creation.py Outdated Show resolved Hide resolved
dask/array/creation.py Outdated Show resolved Hide resolved
@jakirkham
Copy link
Member

@jakirkham jakirkham commented Feb 14, 2019

Thanks for the updates @horta. Added a couple comments above. Otherwise LGTM. @shoyer @mrocklin, any other thoughts?

@horta
Copy link
Contributor Author

@horta horta commented Feb 14, 2019

Thanks, @jakirkham .

@mrocklin
Copy link
Member

@mrocklin mrocklin commented Feb 17, 2019

@jakirkham if you're comfortable with this PR then I encourage you to merge (I'm trying to get more people to become comfortable with pressing the green button).

@jcrist
Copy link
Member

@jcrist jcrist commented Feb 19, 2019

Thanks @horta, merging!

@jcrist jcrist merged commit faefaa8 into dask:master Feb 19, 2019
2 checks passed
@jakirkham
Copy link
Member

@jakirkham jakirkham commented Feb 19, 2019

@mrocklin, as I'd requested feedback from others right before the 3-day weekend, figured I'd wait to see if I heard back this week to give people some time before clicking the merge button.

@mrocklin
Copy link
Member

@mrocklin mrocklin commented Feb 19, 2019

@jakirkham
Copy link
Member

@jakirkham jakirkham commented Feb 22, 2019

No worries. Thanks for the encouragement.

@jakirkham
Copy link
Member

@jakirkham jakirkham commented Mar 25, 2019

Just out of curiosity, @horta, were you planning on implementing da.trace as well? Asking since you had mentioned it in the OP. :)

@horta
Copy link
Contributor Author

@horta horta commented Apr 4, 2019

@jakirkham sure, I aim to implement that by sunday

jorge-pessoa pushed a commit to jorge-pessoa/dask that referenced this issue May 14, 2019
* da.diagonal

* no need for asarray

* Direct asarray and use of np.diagonal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants