Skip to content

[Sad Catapella N4][Data integrity] PlaneRecord and CSV reader accept negative plane coordinates; direct records also accept fractional coordinates #44

Closed

Description

@guijacquemet

Audit basis

Normalization Batch 4 at f784c95e3049483f87466150ffc5764375fa631d. Confirmed API/schema validation gap; no tests run. Focused on plane identity, not channel coercion (already #38).

Evidence

Reproducers

PlaneRecord('control/r1/a.tif','control','r1','single',histogram,z=-1,t=1.5) constructs and produces a noncanonical plane_id. Writing a record with z=-1 then reading it back also passes the current integer parser and preserves negative coordinate. This represents an impossible zero-based image position rather than a valid microscopy plane.

Fix / acceptance

Validate z and t as genuine nonnegative integral indices (allow NumPy integer types, explicitly reject booleans/fractions/strings according to documented public construction policy); preserve None→0 only for documented absent axes. Reject negative integers in the CSV reader with CsvFormatError naming row and column; direct construction should raise immediately. Do not silently truncate or clamp. Add z/t=-1, booleans, fractions, NaN, large valid positions, None, and ordinary round trips; ensure time-key stability across conversions. Consider extending checks to blank/invalid identity labels as a separate explicit contract decision, not silently inventing them. No Numba opportunity.

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