Conversation
slevang
commented
Sep 12, 2024
| # Create a root node for this object with its params as attrs | ||
| ds_root = xr.Dataset(attrs=dict(params=self.get_params())) | ||
| dt = DataTree(data=ds_root, name=type(self).__name__) | ||
| dt = DataTree(ds_root, name=type(self).__name__) |
Contributor
Author
There was a problem hiding this comment.
To maintain compatibility with prior versions I changed all cases of data= to be the first positional arg, since the kwarg is now dataset.
| dt_transformer = transformer_obj.serialize() | ||
| # Place the serialized transformer in the tree | ||
| dt[name] = dt_transformer | ||
| dt[name].parent = dt |
Contributor
Author
There was a problem hiding this comment.
Not sure why I had this here anyways
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #226
Lot's of changes to datatree on xarray main since the latest release. These 3 all tripped us up:
pydata/xarray#9297
pydata/xarray#9444
pydata/xarray#9476
Maybe it was a little early to enable using the migrated datatree since it's not technically public API yet but I suppose it let's us fix these issues quickly.