fix(python): ship the core tone-map NaN fix in the wheel#51
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
2 tasks
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.
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 fromtone="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).tone="auto"must stay mostly white. Verified to fail against the pre-fix core and pass now.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)