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

Check explicit indexes when comparing two xarray objects #5812

Open
benbovy opened this issue Sep 23, 2021 · 2 comments
Open

Check explicit indexes when comparing two xarray objects #5812

benbovy opened this issue Sep 23, 2021 · 2 comments

Comments

@benbovy
Copy link
Member

benbovy commented Sep 23, 2021

Is your feature request related to a problem? Please describe.
With the explicit index refactor, two Dataset or DataArray objects a and b may have the same variables / coordinates and attributes but different indexes.

Describe the solution you'd like
I'd suggest that a.identical(b) by default also checks for equality betweena.xindexes and b.xindexes.

One drawback is when we want to check either the attributes or the indexes but not both. Should we add options like suggested in #5733 then?

@benbovy benbovy mentioned this issue Sep 23, 2021
54 tasks
@dcherian
Copy link
Contributor

dcherian commented Sep 23, 2021

I also think identical should check xindexes for equality.

I think those options could be provided for assert_equal where you can turn on/off the checking of indexes and attrs.

That makes identical a really strict check; while equal is a little looser, and allows some configuration

@mathause
Copy link
Collaborator

See the unfinished PR #4760 (which I likely won't finish) for inspiration on adding an argument to assert_* (which I found non trivial).

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

No branches or pull requests

3 participants