Skip to content

[Sad Catapella N3][Correctness] Direct Parameters/NormalizationParameters accept invalid offsets and scales #36

Closed

Description

@guijacquemet

Baseline and classification

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

Reproduction (source proof)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions