Repository navigation
Conversation
antonsoo
force-pushed
the
fix/persistence-image-grid
branch
from
October 18, 2026 12:36
3163c55 to
bd476de
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #113 +/- ##
==========================================
+ Coverage 79.28% 79.47% +0.19%
==========================================
Files 20 20
Lines 1477 1491 +14
Branches 271 275 +4
==========================================
+ Hits 1171 1185 +14
Misses 229 229
Partials 77 77 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
PersistenceImager(birth_range=(0, 4.3), pers_range=(0, 4.3), pixel_size=0.1)currently creates a 42-by-42 grid with spacing about 0.1023. Constructor truncation and conversion of rounded widths back to integer counts lose pixels; parameter setters can produce similar errors or expand an unchanged grid.Compute integer counts first, derive the covered widths from them, and apply the existing centered padding to constructor ranges too. Preserve the other axis when updating one range, and keep the mesh unchanged when reassigning an unchanged parameter. Handle quotient roundoff without adding a pixel to exact multiples, including both
3 * 0.1and literal0.9 / 0.3.Validation: 13 of 31 new constructor/setter/rounding cases fail before; all 31 pass after. The complete suite on current master passes 155 tests, with the existing 19 warnings. Ruff format/lint, wheel/sdist builds and metadata checks pass.
On 360 persistence-image outputs from recorded handwritten-digit diagrams, this corrects 120 shapes and all 84 spacing errors. Every corrected image agrees with an independent Gaussian rectangle-CDF reference (maximum absolute pixel error 1.8e-16). Of the 240 previously correct shapes, 228 outputs stay byte-identical; the other 12 change only last-bit pixel values.