Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
6e9817c
feat: add rich display for doc and da
Jan 17, 2023
2941269
fix: wip plot
Jan 18, 2023
5949e7c
fix: wip plot
Jan 18, 2023
05fa0fa
fix: wip plot
Jan 19, 2023
718fe52
feat: add math package and minmax normalize
Jan 19, 2023
3669de1
fix: summary for document
Jan 19, 2023
c56e975
chore: update poetry lock after rebase
Jan 19, 2023
b0ba3f3
fix: move all from plotmixin to base document
Jan 19, 2023
bd8cf3b
feat: add docs schema summary
Jan 20, 2023
25be9cc
feat: add document array summary
Jan 20, 2023
b7a915b
fix: display doc within doc
Jan 20, 2023
c6ee8ec
fix: in notebook print docs summary
Jan 20, 2023
d45988a
fix: move summary from da to abstract da
Jan 23, 2023
40c8eea
fix: get schema for doc
Jan 23, 2023
3bdb9d0
fix: wip doc summary
Jan 23, 2023
ea12600
fix: wip clean up
Jan 23, 2023
9321c0b
test: add test for da pretty print
Jan 23, 2023
189c33c
docs: update note
Jan 23, 2023
93046af
docs: add some documentation
Jan 23, 2023
fc0deec
fix: apply samis suggestion
Jan 23, 2023
c8f3849
fix: mypy checks
Jan 23, 2023
15b94fc
fix: move to plot mixin
Jan 23, 2023
58229aa
fix: remove redundant line
Jan 24, 2023
e55ba3b
fix: remove comments
Jan 24, 2023
147742d
feat: add schema highlighter
Jan 24, 2023
59bd3a6
fix: add plotmixin to mixin init
Jan 24, 2023
fd26a43
fix: adjust da summary
Jan 24, 2023
675b5c5
fix: move minmaxnormalize to comp backend
Jan 24, 2023
a375d19
fix: remove redundant lines
Jan 24, 2023
c3b44bd
fix: add squeeze and detach to comp backend
Jan 24, 2023
0d5653c
fix: apply suggestion from code review
Jan 24, 2023
6d479ab
refactor: rename iterable attrs
Jan 24, 2023
a1c4678
fix: clean up
Jan 24, 2023
3aac1c9
fix: import
Jan 24, 2023
eb75060
fix: iterate over fields instead of annotations
Jan 24, 2023
3cc1b55
fix: remove math package since moved to comp backends
Jan 24, 2023
ab585eb
refactor: use single quotes
Jan 24, 2023
b838ec9
fix: apply suggestions from code review
Jan 24, 2023
c56aa6e
fix: extract summary to doc summary class
Jan 24, 2023
b2b5bdd
fix: add pretty print for base document
Jan 25, 2023
7aa7e58
fix: use rich capture instead of string io
Jan 25, 2023
2ae8d6a
fix: add colors for optional and union and use only single quotes
Jan 25, 2023
0b881b1
fix: extract display classes to display package
Jan 25, 2023
6ba4eff
fix: make da not optional in da summary
Jan 25, 2023
a70142a
fix: set _console instead of initializing new one everytime in __str__
Jan 25, 2023
2a6bd5c
fix: put console at module level
Jan 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: add colors for optional and union and use only single quotes
Signed-off-by: anna-charlotte <[email protected]>
  • Loading branch information
anna-charlotte committed Jan 25, 2023
commit 2ae8d6a628c110670d9826b26bd57ec49d454831
20 changes: 11 additions & 9 deletions docarray/plotting/document_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def _get_schema(
def __rich_console__(self, console, options):
kls = self.doc.__class__.__name__
id_abbrv = getattr(self.doc, 'id')[:7]
yield f":page_facing_up: [b]{kls}" f"[/b]: [cyan]{id_abbrv} ...[cyan]"
yield f':page_facing_up: [b]{kls} [/b]: [cyan]{id_abbrv} ...[cyan]'

from rich import box, text
from rich.table import Table
Expand Down Expand Up @@ -242,17 +242,19 @@ class SchemaHighlighter(RegexHighlighter):
"""Highlighter to apply colors to a Document's schema tree."""

highlights = [
r"(?P<class>^[A-Z][a-zA-Z]*)",
r"(?P<attr>^.*(?=:))",
r"(?P<attr_type>(?<=:).*$)",
r"(?P<other_chars>[\[\],:])",
r'(?P<class>^[A-Z][a-zA-Z]*)',
r'(?P<attr>^.*(?=:))',
r'(?P<attr_type>(?<=:).*$)',
r'(?P<union_or_opt>Union|Optional)',
r'(?P<other_chars>[\[\],:])',
]

theme = Theme(
{
"class": "orange3",
"attr": "green4",
"attr_type": "medium_purple3",
"other_chars": "black",
'class': 'orange3',
'attr': 'green4',
'attr_type': 'medium_orchid',
'union_or_opt': 'medium_purple4',
'other_chars': 'black',
}
)