Skip to content

Add unravel_index - #3958

Merged
jakirkham merged 5 commits into
dask:masterfrom
jakirkham:add_unravel_index
Sep 17, 2018
Merged

jakirkham merged 5 commits into
dask:masterfrom
jakirkham:add_unravel_index

Conversation

@jakirkham

@jakirkham jakirkham commented Sep 6, 2018 •

Copy link
Copy Markdown
Member

Partially addresses ( #2557 ).

Implements NumPy's unravel_index for Dask Arrays.

  • Tests added / passed
  • Passes flake8 dask

@jakirkham
jakirkham force-pushed the add_unravel_index branch 8 times, most recently from 95a4fe3 to 78269ce Compare September 7, 2018 01:09
@jakirkham

jakirkham commented Sep 7, 2018 •

Copy link
Copy Markdown
Member Author

As usual, Windows is doing something strange with integers. According to NumPy's source this should be of intp type, but for some reason the test fails on Windows anyways. Am likely missing something. Unfortunately iterating on AppVeyor is not a particularly good way to figure this out. If a Windows user or someone with access to Windows can advise, that would be great. Otherwise I'm tempted to just skip the test on Windows and let a Windows user correct this.

Edit: Going to give this one last try.

@jakirkham

Copy link
Copy Markdown
Member Author

Fixed! 🎉 😄

@jakirkham

Copy link
Copy Markdown
Member Author

Planning on merging tomorrow if no comments.

@mrocklin

Copy link
Copy Markdown
Member

@jakirkham and @hmaarrfk you two might want to trade reviewing each others' PRs at #3958 and #3964

Comment thread dask/array/routines.py Resolved
Comment thread dask/array/tests/test_routines.py Resolved
Provides a Dask Array implementation of NumPy's `unravel_index`. This is
useful if one has a Dask Array full of 1-D indices and would like to
convert them to N-D indices instead.
Make sure `unravel_index` is available from `dask.array`.
Ensure that the Dask Array `unravel_indices` implementation matches that
of the NumPy one in some common cases.
Include `unravel_index` in the Dask Array API docs.
Try comparing the selection of Dask Array points with those of a NumPy
selection. Requires `vindex` as Dask Array does not support fancy
indexing.
@jakirkham

Copy link
Copy Markdown
Member Author

Will plan on merging end of day Monday if there is nothing else.

@jakirkham
jakirkham merged commit 17c8a8e into dask:master Sep 17, 2018
@jakirkham
jakirkham deleted the add_unravel_index branch September 17, 2018 22:01
@hmaarrfk

Copy link
Copy Markdown
Contributor

Cool stuff!

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.

3 participants