Skip to content

feat(batch): runner + result + store (#700) - #729

Merged
jepegit merged 1 commit into
masterfrom
700-batch-v3-runner
Jul 26, 2026
Merged

feat(batch): runner + result + store (#700)#729
jepegit merged 1 commit into
masterfrom
700-batch-v3-runner

Conversation

@jepegit

@jepegit jepegit commented Jul 26, 2026

Copy link
Copy Markdown
Owner

A4 — batch v3: runner + result + store

Fourth arc of Epic A (batch v3, #696), on A3. Per-cell work becomes a pure function; serial vs parallel is a choice of executor, not a 300-line clone. Additive.

result.pyerrors are data

  • CellResult / BatchResult — per-cell outcome, timing, source, captured exception; loaded/failed/skipped partitions, cells(), raise_if_failed() (strict mode), report() → tidy polars frame (the dataframe the legacy errors list only hinted at).

store.py — lazy Mapping, no mangling

  • CellStore — lazy Mapping[str, CellpyCell] with caching, first/sample/unload, and _ipython_key_completions_ for store["<TAB>"]. Fixes the str.lstrip label-mangling bug (batch_core.py:180 turned xenon_cellenon_cell) — covered by a regression test.

runner.py

  • load_cell(spec, policy) — maps a resolved CellSpec onto cellpy.get (source AUTO/CELLPY_ONLY/RAW_ONLY); errors captured unless accept_errors=False. No prints, no journal mutation.
  • run(journal, policy) — serial executor with a progress callback (the engine never imports tqdm/prints). Process pool is A8 (A8: batch v3 — process-pool executor + handover #704).

Tests — tests/test_batch_v3_runner.py (9, all green)

Result partitioning/report/raise_if_failed; lazy store + label-mangling regression; load_cell from a real cellpy file + error capture + re-raise; run over a journal + bad-cell skipping. (Full batch-v3 suite: 28 green.)

Next: A5 (#701) — aggregate/qc/outputs. Part of #696.

🤖 Generated with Claude Code

Fourth arc of Epic A (batch v3, #696).

- result.py: CellResult/BatchResult - "errors are data". Per-cell outcome,
  timing, source, captured exception; loaded/failed/skipped partitions,
  raise_if_failed() (strict mode), report() -> tidy polars frame.
- store.py: CellStore, a lazy Mapping[str, CellpyCell] with caching, first/
  sample/unload and _ipython_key_completions_ for tab completion. Fixes the
  str.lstrip label-mangling bug (batch_core.py:180: 'xenon_cell'->'enon_cell').
- runner.py: load_cell(spec, policy) -> CellResult mapping a resolved CellSpec
  onto cellpy.get (source preference AUTO/CELLPY_ONLY/RAW_ONLY), errors
  captured unless accept_errors=False; run(journal, policy) serial executor
  with a progress callback (no tqdm/prints in the engine). Process pool is A8.

9 tests: result partitioning/report/raise_if_failed, lazy store + no label
mangling, load_cell from a real cellpy file + error capture + re-raise, run
over a journal + bad-cell skipping.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jepegit jepegit added this to the v.2.1 milestone Jul 26, 2026
@jepegit jepegit added the cellpy2-stage4 cellpy 2.1 (Stage 4): batch/collectors redesign, utils waves 3-4, F6, shim removals label Jul 26, 2026
@cursor

cursor Bot commented Jul 26, 2026

Copy link
Copy Markdown

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.

@jepegit
jepegit merged commit 12f2d5f into master Jul 26, 2026
6 checks passed
@jepegit
jepegit deleted the 700-batch-v3-runner branch July 26, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cellpy2-stage4 cellpy 2.1 (Stage 4): batch/collectors redesign, utils waves 3-4, F6, shim removals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant