-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate formatting_html.py into xarray core #10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to delete formatting_html.py
and test_formatting_html.py
in datatree_
.
@@ -18,6 +18,9 @@ | |||
from xarray.core.coordinates import DatasetCoordinates | |||
from xarray.core.dataarray import DataArray | |||
from xarray.core.dataset import Dataset, DataVariables | |||
from xarray.core.formatting_html import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated import statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have strong opinions, this looks reasonable to me. If this were my PR I'd change some of the names since the new functions are merged into existing files and I'd want to make sure people knew the fxns were for datatree
xarray/core/formatting_html.py
Outdated
@@ -341,3 +343,128 @@ def dataset_repr(ds) -> str: | |||
] | |||
|
|||
return _obj_repr(ds, header_components, sections) | |||
|
|||
|
|||
def summarize_children(children: Mapping[str, Any]) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might find a way to identify these moved files as datatree specific.
e.g summarize_datatree_children
and datatree_node_repr
, _wrap_datatree_repr
. pick what makes sense to you and use that through out.
return request.param | ||
|
||
|
||
class Test_summarize_datatree_children: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed these test classes so they would be more descriptive.
oopsies This reverts commit d68ae3c.
3aba6da
to
e16a01c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thankyou for working on this @eni-awowale ! The main question I have before diving deeper is whether or not you have any time to look into the annoying bug which squeezes the width of the html output - see xarray-contrib/datatree#91
* DAS-2064: rename/relocate mapping.py -> xarray.core.datatree_mapping.py DAS-2064: fix circular import issue. * DAS-2064 - Minor changes to datatree_mapping.py. --------- Co-authored-by: Matt Savoie <matthew.savoie@colorado.edu>
This was merged to the main repo pydata#8930 |
Draft:
This PR migrates the
formatting_html.py
module toxarray/core/formatting_html.py
as part of the on-going effort to mergexarray-datatree
intoxarray
.One thing of note is that importing and setting the
OPTIONS
to"default"
indatatree/formatting_html.py
(lines) were moved intoxarray/core/options.py
on #L23 and #L49. So, I did not add them back toxarray/core/formatting_html.py
.datatree/formating_htmls.py
Track merging datatree into xarray pydata/xarray#8572User visible changes (including notable bug fixes) are documented in whats-new.rstNew functions/methods are listed in api.rst