| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@anna-charlotte I believe we should tackle pretty printing in this PR as well. at the moment pritting a document array will lool like this <docarray.array.abstract_array.DocumentArray[Document][MyDoc] at 0x7fb93800b5e0> which is not very informative. Same apply to document |
Sorry, something went wrong.
|
Wrt pretty prints: this PR only includes the pretty print for DocumentArray but not for Document, since for the latter I encountered the following problem: rich provides a nice pretty print for pydantic models, which we would like to use as the Documents __repr__(). class MyDoc(pydantic.BaseModel):
title: str
mydoc = MyDoc(title='my title')
rich.print(mydoc)output: MyDoc(
title='my title'
)
But for the Documents .summary() we overwrite the __rich_console__() function to the tabular print wanted for the summary such as: mydoc.summary()----------------------------------------- | Attribute | Value | ----------------------------------------- | title | 'my title' | ----------------------------------------- This __rich_console__() is also being called in the rich.print(mydoc), which results in a tabular summary display for the pretty print instead of the pydantic pretty print. I opened a question in their discussion to see if there is a nice way to solve this. Therefore for now only pretty print for DocumenArray. |
Sorry, something went wrong.
|
@anna-charlotte could you please link this PR/Issue to the dev roadmap and tick it off once merged? |
Sorry, something went wrong.
There was a problem hiding this comment.
Honestly I am lost in all of this rich stuff, but the screenshots look pretty, so that's a thumbs up from me ^^
Sorry, something went wrong.
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
|
📝 Docs are deployed on https://ft-feat-rich-display--jina-docs.netlify.app 🎉 |
Sorry, something went wrong.
* feat: add rich display for doc and da Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: wip plot Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: wip plot Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: wip plot Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * feat: add math package and minmax normalize Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: summary for document Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * chore: update poetry lock after rebase Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: move all from plotmixin to base document Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * feat: add docs schema summary Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * feat: add document array summary Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: display doc within doc Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: in notebook print docs summary Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: move summary from da to abstract da Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: get schema for doc Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: wip doc summary Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: wip clean up Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * test: add test for da pretty print Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * docs: update note Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * docs: add some documentation Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: apply samis suggestion Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: mypy checks Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: move to plot mixin Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: remove redundant line Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: remove comments Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * feat: add schema highlighter Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: add plotmixin to mixin init Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: adjust da summary Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: move minmaxnormalize to comp backend Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: remove redundant lines Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: add squeeze and detach to comp backend Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: apply suggestion from code review Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * refactor: rename iterable attrs Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: clean up Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: import Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: iterate over fields instead of annotations Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: remove math package since moved to comp backends Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * refactor: use single quotes Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: apply suggestions from code review Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: extract summary to doc summary class Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: add pretty print for base document Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: use rich capture instead of string io Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: add colors for optional and union and use only single quotes Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: extract display classes to display package Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: make da not optional in da summary Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: set _console instead of initializing new one everytime in __str__ Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> * fix: put console at module level Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai> Signed-off-by: Joan Fontanals Martinez <joan.martinez@jina.ai>
| Back | FazBrowse Home | New Git URL |
Goals:
Pretty prints:

For Document:
Example:
For DocumentArray: