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 N3][Correctness] Direct Parameters/NormalizationParameters accept invalid offsets and scales #36
Normalization Batch 3 f784c95e3049483f87466150ffc5764375fa631d. Confirmed constructor validation gap by implementation tracing; no package tests executed. Both public parameter representations should agree on numeric invariants.
Evidence
Parameters.__post_init__ lines 104–120 converts offsets/scales to float but checks only shape and channel indices. NaN, inf, zero and negative scales all pass.
NormalizationParameters lines 33–40 likewise has no invariant validation; the normal fitting helper _parameters checks scale but not offset finiteness, so only callers using that helper receive even partial checks.
Parameters('z-score','image',None,True,(float('nan'),),(0.0,)) constructs successfully and .apply(np.array([2.])) returns nonfinite values rather than refusing the invalid normalization. p.to_columns() serializes nan and 0.0, but Parameters.from_columns(p.to_columns(), NormalizationSettings(method='zscore')) refuses these values.
Fix and acceptance
Validate offset finite and scale finite strictly positive upon construction for fluorescence; decide/document the RGB epsilon/shared-scale requirements. Apply the same invariant to NormalizationParameters. Preserve explicit nonfinite input pixels as nonfinite results; do not conflate them with invalid parameters. Reject invalid constructor arguments before application/serialization. Test NaN/±inf offset and scale, zero/negative scale, valid very small scale, fit-produced parameters and exact round trips. Keep messages naming channel and invalid value. No Numba use.
Activity