Stage 1.3: move cellpy-file read/write paths into cellpy_file/ (#448)#483
Merged
Conversation
…448) Move HDF5 version gate, v8 reader, legacy v3-v7 readers, and shared extractors out of CellpyCell into cellpy_file/read.py and legacy_read.py. Introduce LoadResult; CellpyCell.load() becomes a thin wrapper. Stage 1.3 commit 1 of 2 — behavior preserved per roundtrip oracles. Co-authored-by: jepe <jepe@ife.no>
Move infotable building and HDF5 persistence into cellpy_file/write.py with a single owned store lifecycle. CellpyCell.save() keeps policy checks and delegates I/O. Lazy __init__ exports avoid prms import cycle. Stage 1.3 commit 2 of 2. Co-authored-by: jepe <jepe@ife.no>
jepegit
marked this pull request as ready for review
July 13, 2026 16:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Implements Stage 1.3 (file-plan Steps 4 + 5): extracts the cellpy-file HDF5 read and write paths from
CellpyCellinto dedicated modules undercellpy/readers/cellpy_file/.read.py— version gate, v8 reader, shared extractors, publicload()→LoadResultlegacy_read.py— v3–v7 readers + old-meta unit-label conversionwrite.py—create_infotable()+save()with a singlewith HDFStorelifecycle (fixes open-store-across-functions)selectors.py— addsLoadResultCellpyCell.load()/save()— thin wrappers; save policy checks unchangedDepends on #447 (helpers +
LoadSelector/LoadLimits).Test plan
uv run pytest tests/test_cellpy_file_roundtrip.py(10 passed)uv run pytest -m essential(82 passed)Closes #448