Skip to content

Conversation

@TomNicholas
Copy link
Member

@TomNicholas TomNicholas commented Jun 4, 2024

(This is just pseudocode that I'm showing to compare against #9063)

@TomNicholas TomNicholas added the topic-DataTree Related to the implementation of a DataTree class label Jun 4, 2024
Comment on lines +990 to +995
return merge_core(
[existing_variables, candidate_variables],
priority_arg=1,
explicit_coords=list(candidate_variables.keys())
combine_attrs="override",
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should just be align like in #9056

# TODO should we be keeping track of which variables were coordinates?
all_inherited_variables.update(**inheritable_variables)

return DataTree.copy().update(all_inherited_variables)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one possibility - this provides the user with a way to access inherited variables without enforcing that constraint on all trees.

@TomNicholas
Copy link
Member Author

Closing as a WIP attempt to implement something we decided against in #9077 (i.e. we decided not to allow child nodes to have variables which don't align with parents).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-DataTree Related to the implementation of a DataTree class

Projects

Development

Successfully merging this pull request may close these issues.

1 participant