feat(batch): batch v3 package - journal model + layout (#698) - #727
Merged
Conversation
Start the batch v3 redesign (Epic A, #696) as a new cellpy/batch/ package built alongside the old utils/batch_tools. - layout.py: BatchPaths (pure, immutable path computation) + ensure_dirs() as the ONLY mkdir - splits the concern the legacy paginate() conflated (dumpers created folders as a side effect of exporting). - journal.py: Journal model with polars pages (keys-in-columns: the cell label is a `filename` column, never an index) + read_journal/write_journal round-tripping the compatible info_df/metadata/session JSON format, and journal_from_frame. raw_file_names is normalised to List[str], removing the legacy str-or-list ambiguity. Follow-ups within #698: custom-JSON reader (folds #345), Excel read-only, legacy old-shape loader. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- read_custom_json/journal_from_custom_json: read arbitrary JSON into pages via a source->journal column map; requires a filename mapping (folds #345). - read_journal now dispatches on suffix; .xlsx is read-only (reads the pages sheet + optional meta), and write_journal rejects .xlsx with a clear error (Excel journals are read-only in batch v3). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
A2 — batch v3 package foundation:
journal+layoutSecond arc of Epic A (batch v3, #696). Starts the redesign as a new
cellpy/batch/package built alongside the oldutils/batch_tools(nothing removed here — that's E4). Guarded by the A1 characterization net (#697).cellpy/batch/layout.pyBatchPaths— frozen, pure path computation (project_dir/batch_dir/raw_dir/journal_file), layout identical to the modernpaginatedefault (<project_dir>/dump/...).ensure_dirs()— the only mkdir, splitting the concern the legacypaginate()conflated (dumpers created folders as a side effect of exporting).cellpy/batch/journal.pyJournalmodel — polars pages with keys-in-columns (cell label is afilenamecolumn, never an index);session/metaseparated from serialization.read_journal/write_journal— round-trip the compatibleinfo_df/metadata/sessionJSON;raw_file_namesnormalized toList[str](kills the legacy str-or-list ambiguity).read_custom_json/journal_from_custom_json— read arbitrary JSON into pages via a source→journal column map (folds batch - read custom json #345; requires afilenamemapping).read_journalreads.xlsx(pages sheet);write_journalrejects.xlsxwith a clear error (metadata plan Step 4).journal_from_frame(polars/pandas).Tests —
tests/test_batch_v3.py(10, all green)JSON read + round-trip value-parity, from_frame, non-journal rejection, custom-JSON (+ filename-required), Excel read + write-guard,
BatchPathspurity,ensure_dirsidempotence.Follow-ups in later Epic A arcs:
policy.py(#699),runner/store(#700), aggregation/QC/outputs (#701), facade (#702).Part of #696. Folds #345.
🤖 Generated with Claude Code