TST: simplify mask in pcolor writing to mask test #26273
Merged
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.
PR summary
This PR unbreaks CI by modifying the failing test.
Since the X and Y shape match the Z shape, they represent the centres of the boxes.
pcolor
therefore needs to work out the locations of the box corners. In this case, every other column of X and Y were masked, sopcolor
can't reasonably be expected to do that.It previously passed because our use of
np.hstack
stripped the mask off, so it was the same as if we'd not added the mask to begin with. For the test data, there were sensible numbers under the mask but this would obviously not be true in general. We now (since #25027) usenp.ma.hstack
.matplotlib/lib/matplotlib/axes/_axes.py
Lines 5834 to 5837 in fff2a79
The point of the test is to verify that we don't attempt to write anything back to the input mask (#26230) . It doesn't matter for those purposes which elements are
True
orFalse
.PR checklist