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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems very strange to me that this would make some of the tests fail.
pint
didn't release recently, so this should not happen. I tried to rerun, let's see if that changes anything.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems to be due to a circular import:
pint.compat
tries to importxarray
objects.pytest.importorskip
silences the import error somehow, so we get partially initialized modules. I'm somewhat surprisedpint
still does that, I thought we switched to comparing names some time ago.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was actually the other way around! We had to change from name-based comparison to actual type checks since both xarray and measurements have a
Variable
class, and they need to be treated completely differently (see hgrecco/pint#959).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I see. There should be a way to compare without importing (maybe using fully-qualified names like
xarray.Variable
orxarray.core.variable.Variable
), but I guess to really fix this we need figure out #3950.