Skip to content

feat(plate): surface explicit plate_id and well_id string (A03) in plate audits #66

Description

@ferrinm

What to build

Plate audits today carry row/column integer indices per field but not the human-readable well identifier ("A03") that BigQuery well_id expects, and no plate_id at all. Populate both.

Scope

Extend the plate audit shape (see src/zarrmony/writers/plate.py and the plate block written by _convert_plate in src/zarrmony/api.py):

  1. Top-level plate.plate_id — extract the plate identifier from the source metadata:
    • CZI: ImageDocument/Metadata/Information/Image/Dimensions/S/Scenes/Scene[@Name] or plate-level Plate element (varies by version).
    • Opera Phenix / other HCS plate readers: their plate metadata surface.
    • Fail-safe: omit the key when not extractable.
  2. Per-field well_id string — add the concatenated well identifier (e.g. "A03", "B12") to each entry in fields[]. Derive from existing row/column indices via the same helper that _WELL_KEY_RE inverts. Alphabetic row letter + zero-padded column matches BigQuery's expected format.

Where the values land

Under the ADR-0007-locked plate audit shape (schema-3 fields + plate). Also surface plate_id in inspect().plate_layout so pre-flight ingest can read it without a full conversion.

Acceptance criteria

  • plate.plate_id populated in the convert audit on a representative CZI plate fixture.
  • Each entry in fields[] carries well_id in "<row-letter><col-number>" format matching BigQuery's convention.
  • inspect().plate_layout.plate_id populated when available.
  • Missing plate_id → key omitted (no null, no empty string).
  • Tests: plate fixture with plate_id, plate fixture without.
  • Cross-format consistency: if Opera Phenix / OP-plate readers exist in the codebase, they populate the same shape; otherwise note in PR that only CZI is covered pending format-specific follow-up.
  • AUDIT_SCHEMA_VERSION bumped.
  • CHANGELOG entry under a minor version bump.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentTriaged and ready for an agent to implement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions