Fix issues with ==
in tests and update to work with numpy 1.25
#917
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.
We seem to have some bugs in our tests that were uncovered by the changes in object array behavior in numpy 1.25. Specifically, in a few places we assert on the equality of
ConservedVars
objects:which looks reasonable enough, but upon inspection:
i.e.,
==
here is doing some strange things, and CV's boolean conversion is questionable. The discretization here is the boundary of a 1D mesh, so it looks like most of the components are doing elementwise equality, except for momentum.If I understand correctly,
ConservedVars
gets its__eq__
operator from arraycontext'swith_container_arithmetic
decorator. @inducer Is the equality operator resulting from this decorator intended to do elementwise comparison? If so, is there a way we can make it work for array containers containing object arrays? Or do we just need to disable==
forConservedVars
, as I've attempted to do here?Questions for the review: