Skip to content

feat(batch)!: cut utils.batch over to the cellpy.batch facade (#703) - #733

Merged
jepegit merged 2 commits into
masterfrom
703-batch-v3-cutover
Jul 26, 2026
Merged

feat(batch)!: cut utils.batch over to the cellpy.batch facade (#703)#733
jepegit merged 2 commits into
masterfrom
703-batch-v3-cutover

Conversation

@jepegit

@jepegit jepegit commented Jul 26, 2026

Copy link
Copy Markdown
Owner

A7 — the cutover: cellpy.utils.batchcellpy.batch ⚠️ breaking

Seventh arc of Epic A (batch v3, #696). cellpy.utils.batch is now a thin shim over the new cellpy.batch package. The 2232-line legacy batch.py is replaced by a ~120-line shim (net −1,984 lines).

Shim

  • init / load / from_journal / naked → return the new cellpy.batch.Batch.
  • init2 / from_journal2 / load_journal / load_pages / process_batch / iterate_batches → deprecated wrappers (warn_once); iterate_batches/process_batch become docs recipes.

DB bridge (prerequisite, first commit)

  • cellpy/batch/db.py journal_from_db() wraps the existing Excel/JSON readers → new polars Journal; Batch.from_db + deferred create_journal() reproduce the legacy init()create_journal() flow.

Facade

  • update() routes unknown legacy kwargs (testing, …) to the loader; Batch.experiment backward-compat adapter keeps helpers/collectors working against the new Batch until they migrate; db argument dict-columns stored as polars Object.

⚠️ Breaking changes (2.1)

  • b.pages is polars (keys-in-columns), not pandas — no .iloc/.loc/.index.
  • Cells via b.cells[label], not b.experiment.data[label].
  • old→new: b.experiment.journal.to_file(...)b.save(...); force_cellpy/force_raw/force_recalcLoadPolicy; b.combine_summaries() returns a tidy polars frame.

Tests

Deferred with reason: the batch_tools import-warning waits for E4 (the new db.py still bridges through batch_tools). The human-readable symbol map is folded into the G3 migration guide.

Closes #703. Part of #696.

🤖 Generated with Claude Code

jepegit and others added 2 commits July 26, 2026 23:33
Groundwork for the A7 cutover: the new facade needs the db path the legacy
init()->create_journal() flow used.

- db.py: journal_from_db() wraps the existing db readers (simple Excel + JSON)
  and converts their pandas pages to the new polars Journal.
- facade: Batch.from_db(), deferred-read create_journal() (init stores db
  config, create_journal performs the read), load(db=...) source.

+2 tests (from_db, create_journal-reads-db). Full batch-v3 suite: 43 green.
…703)

The A7 cutover: `cellpy.utils.batch` is now a thin shim over `cellpy.batch`.
`init`/`load`/`from_journal`/`naked` return the new polars-based `Batch`;
`init2`/`from_journal2`/`load_journal`/`load_pages`/`process_batch`/
`iterate_batches` warn once. BREAKING: `b.pages` is polars (keys-in-columns),
cells are `b.cells[label]` (not `b.experiment.data[...]`).

- facade: `update()` routes unknown legacy kwargs (e.g. `testing`) to the
  loader; `Batch.experiment` backward-compat adapter keeps helpers/collectors
  working; `from_db`/deferred `create_journal` for the init->create_journal flow.
- journal: db `argument` dict-columns stored as polars Object.
- test_batch.py migrated to the new surface (polars pages, `b.cells`, `b.save`);
  reader + batch_tools-direct tests unchanged.
- xfail (re-based by their own redesign): collectors tests (Epic B #706-708),
  helpers.concat_summaries paths (Epic C #706), batch plot snapshot (Epic B).

batch_tools import-warning deferred to E4 (db.py still bridges through it).
Full suite green (essential + full). Closes #703.

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
@jepegit
jepegit enabled auto-merge (squash) July 26, 2026 22:06
@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 a2c34ee into master Jul 26, 2026
5 of 6 checks passed
@jepegit
jepegit deleted the 703-batch-v3-cutover branch July 26, 2026 22:08
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.

A7: batch v3 — utils.batch shims + docs migration

1 participant