Skip to content

[Sad Catapella N6][Contract consistency] RGB Parameters.select permits invalid channel subsets that cannot round-trip through from_columns #50

Closed

Description

@guijacquemet

Baseline and classification

Sad Catapella normalization Batch 6 at f784c95e3049483f87466150ffc5764375fa631d. Confirmed public-API inconsistency by source inspection; no repository test executed. This is distinct from #38 (fractional channel coercion) and #23 (allowed RGB dtypes).

Evidence

Minimal deterministic repro

p = Parameters('rgb percentile 1-99.8','image','g',True,(1.,)*3,(4.,)*3); p.select([2]) currently returns an object that applies to one grayscale channel and serializes, but Parameters.from_columns(p.select([2]).to_columns(), NormalizationSettings(image_type='rgb')) raises an RGB column validation error.

Scientific impact / decision

RGB relies on one jointly fitted RGB normalization: leaving one RGB channel separated can be interpreted as a legitimate independent RGB patch, contrary to the consumer contract. Silent accept at one boundary and refusal at the next produces inconsistent run behavior.

Fix and acceptance

Prefer rejecting Parameters.select with a proper RGB-specific error when a strict subset of (0,1,2) is requested; allow selecting all channels unchanged. If the consortium explicitly wants post-fit RGB channel extraction, instead add a versioned, documented provenance distinction so serialization and consumers support it consistently—never silently coerce a subset back to a full RGB group. Add direct select, apply, to/from-columns, all-channel selection, fluorescence subset, CellPatcher cross-brick regression tests. Do not modify the shared-channel percentile algorithm. No Numba role.

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