Skip to content
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

DataTree.identical should consider checking that coordinates are defined at the same level #9215

Closed
shoyer opened this issue Jul 7, 2024 · 2 comments
Labels
topic-DataTree Related to the implementation of a DataTree class

Comments

@shoyer
Copy link
Member

shoyer commented Jul 7, 2024

What is your issue?

Consider the following two data trees:

one = DataTree.from_dict(
    {
        "/": xr.Dataset(coords={"a": 1}),
        "/b": xr.Dataset(coords={"a": 1}),
    }
)
two = DataTree.from_dict(
    {
        "/": xr.Dataset(coords={"a": 1}),
        "/b": xr.Dataset(),
    }
)

Currently, DataTree.identical() considers one and two to be identical, but the coordinate a is defined redundantly in the first tree.

For most purposes, these DataTree objects are identical, but are edge cases where it could be different, e.g., when wrting these trees to netCDF or Zarr.

It would be helpful if the .identical() checked for such discrepancies, e.g., to facilitate writing unit tests as in #9214.

@shoyer shoyer added the needs triage Issue that has not been reviewed by xarray team member label Jul 7, 2024
@TomNicholas TomNicholas added topic-DataTree Related to the implementation of a DataTree class and removed needs triage Issue that has not been reviewed by xarray team member labels Jul 8, 2024
@TomNicholas
Copy link
Member

Can this be closed after the changes in #9555? That's what I understood from this comment.

@shoyer
Copy link
Member Author

shoyer commented Oct 10, 2024 via email

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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants