Skip to content

docs: update access elements#262

Merged
hanxiao merged 8 commits into
mainfrom
docs-update-access-elements
Apr 7, 2022
Merged

docs: update access elements#262
hanxiao merged 8 commits into
mainfrom
docs-update-access-elements

Conversation

@alaeddine-13

Copy link
Copy Markdown
Member

docs: update access elements page

@codecov

codecov Bot commented Apr 7, 2022

Copy link
Copy Markdown

Codecov Report

Merging #262 (d0c2e9b) into main (510dfc9) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #262   +/-   ##
=======================================
  Coverage   86.16%   86.16%           
=======================================
  Files         134      134           
  Lines        6160     6160           
=======================================
  Hits         5308     5308           
  Misses        852      852           
Flag Coverage Δ
docarray 86.16% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 510dfc9...d0c2e9b. Read the comment docs.

Comment on lines +226 to +263
## Index by multi-modal attributes
In case you define a multi-modal Document schema and you create a DocumentArray of multi-modal Documents, you can
select attributes inside each Document:

```python
from docarray import Document, DocumentArray
from docarray.dataclasses.types import dataclass, Text, Image


@dataclass
class MultiModalDocument:
text: Text
image: Image


da = DocumentArray(
[
Document(MultiModalDocument(text='cat', image='cat.jpg')),
Document(MultiModalDocument(text='dog', image='dog.jpg')),
Document(MultiModalDocument(text='bird', image='bird.jpg')),
]
)

# plot images
da['@r.[image]'].plot_image_sprites()

# print text attributes
for text_doc in da['@r.[text]']:
print(text_doc.text)

# select both attributes
da['@r.[image, text]']

# select attributes of the Documents at a given postion
da['@r[1].[text]']
```


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please read the new docs before continuing on this PR, this section needs a rewrite and not needed at all

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I completely remove the section (and keep the other minor changes) or remove the content and point to the selection documented in the dataclass section ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

section removed

@github-actions github-actions Bot added size/xs and removed size/s labels Apr 7, 2022
@github-actions

github-actions Bot commented Apr 7, 2022

Copy link
Copy Markdown

📝 Docs are deployed on https://ft-docs-update-access-elements--jina-docs.netlify.app 🎉

@hanxiao hanxiao merged commit fafce1a into main Apr 7, 2022
@hanxiao hanxiao deleted the docs-update-access-elements branch April 7, 2022 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants