You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 24, 2024. It is now read-only.
This is a product of the recursive way we currently write the reprs, but it's redundant. Xarray Dataset's repr doesn't say Variable over and over again. Instead we should just have it say <datatree.DataTree> once at the top, and then the node structure given is enough to imply that the nodes are also DataTree objects, with just the node names listed.
Automatically truncate long dataset outputs
We need to automatically use xarray's options for truncating dataset reprs pretty brutally to try to keep the string repr size down.
Whether root node has a parent
Datatree objects can be parentless (i.e. a root node) or have a parent (i.e. a subtree). Currently this is communicated by the parent=... part of the first line of the repr. This was motivated by the idea of the repr being executable, but I don't think it's great. It doesn't neatly communicate the idea that there is the rest of the tree above this node, and it's not actually executable either.
What might be better is just to have some kind of ... continuation above the first node.
Representing nameless root nodes
Datatree allows the root node (and the root node only) to have a name of None. (See #81). What's the best way to disambiguate this from having a root node named "None"? Should we use <None>, or would that be ambiguous with "<None>? Should we use string quotation marks around the names of all other nodes (which would be inconsistent with how xarray displays variable names)?
With all these suggestions together we might get something like this:
<datatree.DataTree>
...
│
<None>
│ Dimensions: ()
│ Datavariables:
│ foo<U6'orange'
└── a
│ Dimensions: (y: 3)
│ Coordinates:
│ *y (y) int64012
│ Datavariables:
│ barint640
├── b
│ Dimensions: ()
│ Datavariables:
│ zedfloat64nan
└── c
└── d
Do we think that's any better?
The text was updated successfully, but these errors were encountered:
We've discussed improving the html repr but the string repr could also be improved.
It currently looks like this:
Some things that could be better:
DataTree
over and overThis is a product of the recursive way we currently write the reprs, but it's redundant. Xarray Dataset's repr doesn't say
Variable
over and over again. Instead we should just have it say<datatree.DataTree>
once at the top, and then the node structure given is enough to imply that the nodes are also DataTree objects, with just the node names listed.We need to automatically use xarray's options for truncating dataset reprs pretty brutally to try to keep the string repr size down.
Datatree objects can be parentless (i.e. a root node) or have a parent (i.e. a subtree). Currently this is communicated by the
parent=...
part of the first line of the repr. This was motivated by the idea of the repr being executable, but I don't think it's great. It doesn't neatly communicate the idea that there is the rest of the tree above this node, and it's not actually executable either.What might be better is just to have some kind of ... continuation above the first node.
Datatree allows the root node (and the root node only) to have a name of
None
. (See #81). What's the best way to disambiguate this from having a root node named"None"
? Should we use<None>
, or would that be ambiguous with"<None>
? Should we use string quotation marks around the names of all other nodes (which would be inconsistent with how xarray displays variable names)?With all these suggestions together we might get something like this:
Do we think that's any better?
The text was updated successfully, but these errors were encountered: