Fix #639: unskip and harden the vcenter colormap test - #823
Draft
jessiedoe03-cpu wants to merge 2 commits into
Draft
Fix #639: unskip and harden the vcenter colormap test#823jessiedoe03-cpu wants to merge 2 commits into
jessiedoe03-cpu wants to merge 2 commits into
Conversation
`test_colormap_vcenter` was skipped with "not sure what this does". The
test body already called `pcolor(data, vcenter=...)`, so the intent was
there, but `vcenter` was never plumbed through `PlotAxes._parse_cmap` -
it fell through to the artist and raised:
AttributeError: PolyQuadMesh.set() got an unexpected keyword
argument 'vcenter'
So the test is unskipped and given deterministic assertions, and
`vcenter` is accepted alongside `vmin`/`vmax`: it is forwarded into
`norm_kw`, and selects the diverging normalizer when no norm is given.
The guard against combining these with an explicit `Normalize` instance
now covers `vcenter` too.
The test asserts the centre maps to 0.5 in both discrete and continuous
mode, and that passing `vcenter=` directly matches `norm_kw={'vcenter':}`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
cvanelteren
marked this pull request as draft
September 8, 2026 12:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #639.
test_colormap_vcenterwas skipped with "not sure what this does". The testbody already called
pcolor(data, vcenter=...), so the intent was there - butvcenterwas never plumbed throughPlotAxes._parse_cmap. It fell through tothe artist and raised:
so the test could not simply be unskipped; the parameter had to work first.
What this does
test_colormap_vcenterand replaces the image comparison withdeterministic assertions: the centre maps to 0.5 in both discrete and
continuous mode, and
vcenter=matchesnorm_kw={'vcenter': ...}.vcenterin_parse_cmapalongsidevmin/vmax, forwarding it intonorm_kw, and extends the existing "don't combine these with an explicitNormalizeinstance" guard to cover it.One decision worth your call
When
vcenteris given and nonormis specified, this selects the divergingnormalizer. That seemed the only sensible reading, and it is what the original
skipped test implied - but it is a behaviour choice rather than pure plumbing,
so say if you would rather it were explicit or named differently.
Testing
test_colormap_vcenter: 1 passed, 1 warning in 1.66sultraplot/axes/plot.pyreverted and the new test kept: 1 failed, 1 warning in 1.50s -so the test genuinely covers the change rather than passing regardless.
Any remaining failures in that file are pre-existing
_tkinter.TclErrorissuesin my environment (no display); they fail on the base commit too, and which one
trips varies with run order. Please let CI have the final word.
This patch was written with AI assistance (the code by Google Antigravity, the
review and this pull request prepared with Claude Code) and was reviewed and
tested before submitting by @jessiedoe03-cpu. Happy to revise or close it if it is not the
direction you want.
🤖 Generated with Claude Code