Skip to content

feat(batch): from_cells() -- build a batch from in-memory cells (#787) - #797

Merged
jepegit merged 7 commits into
masterfrom
787-from-cells
Jul 29, 2026
Merged

feat(batch): from_cells() -- build a batch from in-memory cells (#787)#797
jepegit merged 7 commits into
masterfrom
787-from-cells

Conversation

@jepegit

@jepegit jepegit commented Jul 29, 2026

Copy link
Copy Markdown
Owner

No public way existed to build the batch/journal contract collect_summaries/collect_cycles consume from already-loaded CellpyCell objects (cells a GUI/notebook holds in memory). Adds:

  • Batch.from_cells(cells, *, groups=, sub_groups=, group_labels=, selected=, name=, project=) — canonical
  • cellpy.batch.from_cells(...) and a cellpy.collect.from_cells re-export (discoverability)

Accepts {label: cell} or a sequence (labels from cell_name, de-duplicated); builds the polars pages frame (filename/group/sub_group/label/selected) + a populated CellStore. Returns a Batch ready for collect_* or batch.plot().

Tests (new file): dict/list forms, label dedupe, groups/selected honoured, all three entry points.

Closes #787

🤖 Generated with Claude Code

There was no public way to build the batch/journal contract that
collect_summaries / collect_cycles consume from already-loaded CellpyCell
objects (a GUI/notebook holding cells in memory). Add Batch.from_cells
(+ cellpy.batch.from_cells and a cellpy.collect.from_cells re-export):
accepts a {label: cell} mapping or a sequence (labels from cell_name,
de-duplicated), builds the polars pages frame (filename/group/sub_group/
label/selected, optional group_label) and a populated CellStore. Optional
groups/sub_groups/selected/group_labels maps. Returns a Batch ready for
collect_* or batch.plot().

Closes #787

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jepegit
jepegit enabled auto-merge (squash) July 29, 2026 11:42
@cursor

cursor Bot commented Jul 29, 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 4c0659d into master Jul 29, 2026
5 checks passed
@jepegit
jepegit deleted the 787-from-cells branch July 29, 2026 12:59
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.

Public 'collection from in-memory cells' (collect.from_cells / Batch.from_cells)

1 participant