Skip to content

fix: map zero magnitude to black in max_chroma_colormap - #23

Open
kilo-code-bot[bot] wants to merge 1 commit into
masterfrom
fix/max-chroma-zero-black
Open

fix: map zero magnitude to black in max_chroma_colormap#23
kilo-code-bot[bot] wants to merge 1 commit into
masterfrom
fix/max-chroma-zero-black

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

Addresses the CodeRabbit comment about the zero-input contract in max_chroma_colormap.

Issue: Both colormaps' docstrings state that magnitude 0 maps to black, and const_chroma_colormap honors it, but max_chroma_colormap returned a near-black (0.051, 0, 0.001) because the C lookup-table interpolation leaves a tiny residual chroma at J=0.

Fix: Explicitly set zero-valued input to black, consistent with the documented contract and const_chroma_colormap. Updated the docstring example accordingly.

The zero-input behavior is a library concern, separate from the CI migration in #22.

Summary by CodeRabbit

  • Bug Fixes
    • Zero-valued inputs now render explicitly as black.
    • Updated the maximum-chroma colormap example output for zero-magnitude values.

The docstring contract for both colormaps states that magnitude 0 maps to
black, and const_chroma_colormap honors it, but max_chroma_colormap
returned a near-black (0.051, 0, 0.001) due to residual chroma from the
C lookup table interpolation at J=0. Explicitly set zero-valued input to
black, matching the documented contract and const_chroma_colormap.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 02aff8f7-72a4-4b01-932a-4697093594c3

📥 Commits

Reviewing files that changed from the base of the PR and between 410aad7 and 27f5236.

📒 Files selected for processing (1)
  • complex_colormap/cplot.py

📝 Walkthrough

Walkthrough

The colormap now maps exactly zero-valued inputs to black after RGB conversion. The documented zero-magnitude example matches the new output.

Changes

Zero-value colormap output

Layer / File(s) Summary
Zero-value black override
complex_colormap/cplot.py
The RGB conversion maps exactly zero-valued inputs to black. The example output now documents black for zero magnitude.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: mapping zero-magnitude values to black in max_chroma_colormap.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/max-chroma-zero-black

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants