Skip to content

fix(python): ship the core tone-map NaN fix in the wheel#51

Merged
g4bri3lDev merged 1 commit into
mainfrom
fix/python-core-bump
Jul 6, 2026
Merged

fix(python): ship the core tone-map NaN fix in the wheel#51
g4bri3lDev merged 1 commit into
mainfrom
fix/python-core-bump

Conversation

@g4bri3lDev

Copy link
Copy Markdown
Member

The auto tone-map NaN collapse (fixed in core by 6765760 / epaper-dithering-core 4.0.1) never reached PyPI: the Python package depends on core by path and hasn't been released since. Any consumer of the current wheel (5.0.7 and earlier) gets an all-black frame from tone="auto" on crisp bilevel bright images — exactly what odl-renderer produces for text payloads, which is how it surfaced in the HA integration (69-byte uploads, black panels).

  • Adds the Python-level regression test: bilevel white image + measured-style palette + tone="auto" must stay mostly white. Verified to fail against the pre-fix core and pass now.
  • The fix(python): commit makes release-please cut the python package release that actually ships the fixed core in the wheel.

Root-cause chain: bilevel frame → 2nd-percentile luminance = 0.0 → log-skew strength epsilon-negative → (-x).powf(1.4) = NaN → NaN poisons all pixels → nearest-palette resolves to index 0.

(mypy pre-commit hook skipped: it currently fails repo-wide on numpy 2.x stubs — Type statement is only supported in Python 3.12+ — unrelated to this change.)

🤖 Investigated with Claude Fable (Claude Code)

The auto tone-map NaN collapse (bilevel bright images rendered as an
all-black frame) was fixed in epaper-dithering-core 4.0.1, but the
Python package pulls core by path and has had no release since — the
wheel on PyPI still carries the bug. This commit adds the Python-level
regression test (fails against the pre-4.0.1 core, passes now) and
triggers a python package release.

Found in the field: Home Assistant drawcustom with the default
tone=auto uploaded 69-byte all-black frames for any crisp text-on-white
payload rendered by odl-renderer.
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@g4bri3lDev g4bri3lDev merged commit 296b939 into main Jul 6, 2026
6 checks passed
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.

1 participant