Skip to content

Conversation

@JohannesMessner
Copy link
Member

@JohannesMessner JohannesMessner commented Feb 2, 2023

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

@JohannesMessner JohannesMessner added the DocArray v2 This issue is part of the rewrite; not to be merged into main label Feb 2, 2023
@JohannesMessner JohannesMessner self-assigned this Feb 2, 2023
@JohannesMessner JohannesMessner changed the base branch from main to feat-rewrite-v2 February 2, 2023 14:11
Signed-off-by: Johannes Messner <[email protected]>
Signed-off-by: Johannes Messner <[email protected]>
Signed-off-by: Johannes Messner <[email protected]>
Signed-off-by: Johannes Messner <[email protected]>
Signed-off-by: Johannes Messner <[email protected]>
@JohannesMessner JohannesMessner marked this pull request as ready for review February 3, 2023 16:26
Signed-off-by: Johannes Messner <[email protected]>
@github-actions github-actions bot added size/l and removed size/m labels Feb 6, 2023
@JoanFM
Copy link
Member

JoanFM commented Feb 6, 2023

Would u mind adding a description of what it enables?

Signed-off-by: Johannes Messner <[email protected]>
Signed-off-by: Johannes Messner <[email protected]>
Signed-off-by: Johannes Messner <[email protected]>
Signed-off-by: Johannes Messner <[email protected]>
@JohannesMessner JohannesMessner mentioned this pull request Feb 7, 2023
47 tasks
Signed-off-by: Johannes Messner <[email protected]>
Signed-off-by: Johannes Messner <[email protected]>
@github-actions github-actions bot added size/xl and removed size/l labels Feb 7, 2023
@github-actions
Copy link

github-actions bot commented Feb 7, 2023

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 <[email protected]>
@github-actions
Copy link

github-actions bot commented Feb 7, 2023

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
Copy link

github-actions bot commented Feb 7, 2023

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

@JohannesMessner JohannesMessner merged commit de8f70e into feat-rewrite-v2 Feb 7, 2023
@JohannesMessner JohannesMessner deleted the feat-advanced-indexing branch February 7, 2023 10:07
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

5 participants