Skip to content

Commit

Permalink
update patch repr
Browse files Browse the repository at this point in the history
  • Loading branch information
d-chambers committed Jan 11, 2024
1 parent 875902a commit fd84852
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
28 changes: 14 additions & 14 deletions dascore/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,19 @@ def map(self, func, iterables, **kwargs):
dascore_styles = dict(
np_array_threshold=100, # max number of elements to show in array
patch_history_array_threshold=10, # max elements of array in hist str.
dc_blue="#002868",
dc_red="#cf0029",
dc_yellow="#ffc934",
default_coord="bold white",
dc_blue="blue",
dc_red="red",
dc_yellow="yellow",
default_coord="bold",
coord_range="bold green",
coord_array="bold #cd0000",
coord_monotonic="bold #d64806",
coord_degenerate="bold #d40000",
units="#cca3e1",
dtypes="#a2bf48",
keys="#a2bf48",
# these are for formatting datetimes
ymd="#e96baa",
hms="#e96baa",
dec="#e96baa",
coord_monotonic="bold grey",
coord_array="bold orange",
coord_degenerate="bold red",
units="bright blue",
dtypes="bright black",
keys="grey50",
# these are for formatting date times
ymd="blue",
hms="green",
dec="green",
)
2 changes: 1 addition & 1 deletion dascore/core/coordmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ def __rich__(self) -> str:
coord = self.coord_map[name]
coord_dims = self.dim_map[name]
if name in self.dims:
base = Text.assemble("\n * ", Text(name, style="bold"), ": ")
base = Text.assemble("\n *", Text(name, style="bold"), ": ")
else:
base = Text(f"\n {name} {coord_dims}: ")
text = Text.assemble(base, coord.__rich__())
Expand Down
2 changes: 1 addition & 1 deletion dascore/core/coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def __len__(self):

def __rich__(self):
key_style = dascore_styles["keys"]
base = Text("", "default")
base = Text("")
base += Text(self.__class__.__name__, style=self._rich_style)
base += Text("(")
if not pd.isnull(self.min()):
Expand Down
1 change: 1 addition & 0 deletions docs/tutorial/patch.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ time_step = coords.step("time")

Coords also have a useful string representation:


```{python}
print(coords)
```
Expand Down

0 comments on commit fd84852

Please sign in to comment.