Skip to content

docs(design): format records and their layering (#415) - #416

Draft
balbasty wants to merge 11 commits into
mainfrom
claude/docs/415-format-records
Draft

balbasty wants to merge 11 commits into
mainfrom
claude/docs/415-format-records

Conversation

@balbasty

@balbasty balbasty commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

This PR adds docs/design/format-records.md, the design note for #415. Format classes hold a record of their file instead of inheriting a parser. The note also covers how the record relates to the format metadata of #233.

It records the design decided in #415:

  • Layers:
    • the model API (Metadata, Image, Transformation);
    • the dispatchers (MetadataFormat, ImageFormat, TransformationFormat);
    • <X>Metadata holding the <X>Raw header record;
    • <X>Image/<X>Transformation holding <X>Metadata and a raw data object.
  • Inheritance: only the stateless reader/writer bases are inherited. Each class delegates one level down: format object → metadata → raw.
  • Data: raw is the only stored array, and data is a cached view decoded from it by exact, invertible to_model/to_disk pairs.
  • Write precedence: the record, then the geometry from the model, then the header, then the data.
  • Rules and public surface: private submodules; Raw and Metadata classes are public, proxies are private.
  • Relation to the Design memo for the format-metadata framework #306 memo, and the implementation passes.

This is a living document. Its last section, "Open tensions and workarounds", is updated as the implementation PRs find problems, edge cases and workarounds. The implementation goes in stacked PRs, starting with the core (pass 1a) and NIfTI.

Documentation only. ruff check, ruff format --check and codespell are clean.

Refs #415, #233

🤖 Generated with Claude Code

https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8


Generated by Claude Code

Record the decided design of #415: format classes hold a header
record and a raw data object instead of inheriting a stateful parser,
with metadata, dispatcher and format layers, cached data views, write
precedence, the public surface, the relation to the #233 metadata
memo, the implementation passes, the conformance checks and the open
tensions found so far.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8

balbasty commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

lint / spellcheck fails here for a reason outside this PR. The codespell-project/actions-codespell@v2 action could not build its Docker image: "Docker build failed with exit code 1", three attempts. No spell check ran.

The same failure came back on the one re-run. Nothing in this PR can fix it, since it only adds a Markdown file. The same check passed on main at 77e0807 a few hours ago, and uvx codespell -I codespell-ignore-words.txt is clean on this branch locally. I'll check again later and re-run once the action builds.


Generated by Claude Code

Add the tensions and workarounds found while implementing pass 1a to
the design note. Mark the ones that pass 1a resolves and fold the
duplicates into the existing entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8
Add the tensions, decisions and workarounds found while implementing
pass 1b, the NIfTI image, to the design note, and fold the duplicates
into the existing entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants