FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: advanced indexing by JohannesMessner · Pull Request #1074 · docarray/docarray · GitHub

feat: advanced indexing - #1074

Merged
JohannesMessner merged 24 commits into
feat-rewrite-v2from
feat-advanced-indexing
Feb 7, 2023
Merged

feat: advanced indexing#1074
JohannesMessner merged 24 commits into
feat-rewrite-v2from
feat-advanced-indexing

Conversation

JohannesMessner commented Feb 2, 2023
edited
Loading

Copy link
Copy Markdown
Member

Goals:

PyTorch like indexing into DocumentArray and DocumentArrayStacked

da = DocumentArray([... for _ in range(5)]
da[0]  # index by offset; returns doc at this position
da[0:5:2]  # index by slice; returns every other doc
da[0, 1, 2]  # index by sequence of positions; returns DocumentArray with docs at these positions
da[[0, 1, 2]]  # same as above
da[[True, False, True, True, False]]  # index by boolean mask; returns DocumentArray with "True" docs
da[None]  # returns `da`, just to conform with PyTorch convention

This also includes a refactor where in DocumentArrayStacked ._columns is now separated into _doc_columns and _tensor_columns, instead of having both types in the same dict. It makes everything a bit clearer.

closes #1073

Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
JohannesMessner added the DocArray v2 This issue is part of the rewrite; not to be merged into main label Feb 2, 2023
JohannesMessner self-assigned this Feb 2, 2023
JohannesMessner changed the base branch from main to feat-rewrite-v2 February 2, 2023 14:11
Comment thread docarray/array/array.py Outdated
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
JohannesMessner marked this pull request as ready for review February 3, 2023 16:26
Comment thread docarray/array/array.py Outdated
Comment thread docarray/array/array.py Outdated
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
JohannesMessner and others added 3 commits February 6, 2023 13:58
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <44071807+JohannesMessner@users.noreply.github.com>
github-actions Bot added size/l and removed size/m labels Feb 6, 2023
Signed-off-by: Johannes Messner <messnerjo@gmail.com>

JoanFM commented Feb 6, 2023

Copy link
Copy Markdown
Member

Would u mind adding a description of what it enables?

Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
JohannesMessner mentioned this pull request Feb 7, 2023
47 tasks
JohannesMessner and others added 2 commits February 7, 2023 10:01
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <44071807+JohannesMessner@users.noreply.github.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
github-actions Bot added size/xl and removed size/l labels Feb 7, 2023

github-actions Bot commented Feb 7, 2023

Copy link
Copy Markdown

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Signed-off-by: Johannes Messner <messnerjo@gmail.com>

github-actions Bot commented Feb 7, 2023

Copy link
Copy Markdown

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions Bot commented Feb 7, 2023

Copy link
Copy Markdown

📝 Docs are deployed on https://ft-feat-advanced-indexing--jina-docs.netlify.app 🎉

JohannesMessner merged commit de8f70e into feat-rewrite-v2 Feb 7, 2023
JohannesMessner deleted the feat-advanced-indexing branch February 7, 2023 10:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

toch/np like indexig for DocumentArrayStacked

4 participants


Back | FazBrowse Home | New Git URL