You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Sad Catapella B6][Numeric correctness] Micrometre conversion overflow can classify radically different pixel sizes as equal #93
Sad Catapella Batch 6; pinned d7a538e56d41ac1093ba79adcad397c21b3dfd32. Confirmed source-level floating-point defect for finite, positive metadata values that overflow during unit conversion; no test executed.
One image has a metadata X/Y pixel size 1e308 meter (finite, positive), another has 0.5 micrometer. The first conversion multiplies by 1e6 and produces +inf. Under the current comparison abs(0.5 - inf) <= 1e-3 * max(0.5, inf), both sides become inf, so the comparison incorrectly evaluates True. Thus _check_pixel_sizes can suppress different_pixel_sizes even with obviously incomparable sizes. The public same_pixel_size(PhysicalSizes(...)) instead raises on nonfinite converted values, leading to inconsistent behavior between API and preflight.
Fix / tests
Always validate finiteness after unit conversion. Define whether conversion overflow makes a size unknown with an explicit warning, or is a named invalid calibration, but never emit inf as a physical length. Fix both PhysicalSizes.micrometers and to_micrometers; ensure metadata._micrometers and pixel_size_groups cannot pass inf/NaN into comparator. Regression cases: 1e308 meter, near overflow boundaries, picometers at tiny scales, known unit cross-conversion, invalid/infinite metadata and valid physically reasonable values. No Numba; simple scalar validation.
Activity
Merge pull request #133 from CellMigrationLab/claude/fix-um-overflow