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

Method required to compare xarray datasets / coordinates incl. metadata #178

Open
sol1105 opened this issue Jul 1, 2021 · 1 comment
Open

Comments

@sol1105
Copy link
Contributor

sol1105 commented Jul 1, 2021

  • clisops version: dev

Description

Need to implement a comparison between xarray datasets to compare the grids and metadata.
This is required

  • to be able to identify applicable weight files in the (yet to be implemented) cache
  • to be able to set up tests that assert that the desired output grid has been generated / remapped to
@agstephens
Copy link
Collaborator

@sol1105, here are some possible solutions for us to test out:

We might not need to write any extra code.

If we have a situation where we need to do a partial comparison, we can probably do:

assert isinstance(da1, xr.DataArray) 
assert isinstance(da2, xr.DataArray)

da1_part = da1.drop(...stuff we don't want to compare...)
da2_part = da2.drop(...stuff we don't want to compare...)

xr.testing.assert_identical(da1_part, da2_part)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants