fix: assign the "over" color to napari's high_color, not nan_color - #145
Merged
Merged
Conversation
to_napari() checked for napari's high_color field but assigned the over color to nan_color, so high_color was never set and an explicitly configured bad color was silently replaced by the over color. Adds a regression test asserting that low_color, high_color, and nan_color each receive their own color. It requires napari >= 0.6.1, where those three fields were introduced. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Reviewed-By: Codex (gpt-5.6-sol, reasoning effort xhigh)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #145 +/- ##
==========================================
+ Coverage 95.56% 95.60% +0.04%
==========================================
Files 168 168
Lines 2186 2186
==========================================
+ Hits 2089 2090 +1
+ Misses 97 96 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
matthiasschabel
marked this pull request as ready for review
August 9, 2026 21:05
Member
|
thanks |
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.
Colormap.to_napari()checks for napari'shigh_colorfield but assigns the over color tonan_color(src/cmap/_external.py:115), introduced in #103.Two effects:
high_coloris never set, so values above the range fall back to napari's default instead of the requested over color;bad_colorbranch, so an explicitly configuredbadcolor is silently replaced by the over color.One-line fix plus a regression test asserting that
low_color,high_color, andnan_coloreach receive their own color. The test requires napari >= 0.6.1, where those three fields were added — below that the converter correctly skips them.🤖 Generated with Claude Code