Skip to content

Add batch live refresh: Batch.refresh, update(live=True) and poll - #1104

Merged
jepegit merged 3 commits into
masterfrom
782-batch-live
Sep 26, 2026
Merged

jepegit merged 3 commits into
masterfrom
782-batch-live

Conversation

@jepegit

@jepegit jepegit commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Closes #782. Epic #783 (Stage 3, L5). Stacked on #1103 (781-live-poll); retarget once that merges.

What

  • Batch.refresh(labels=None, raise_errors=False, **update_kwargs) -> {label: bool | Exception}: calls CellpyCell.update() on every loaded cell of the lazy store (never triggers a first load) and clears the combined-summary cache when any cell changed, so b.summaries / b.plot() / collectors see the appended data.
  • Batch.update(live=True, **kw): the spec'd spelling; delegates to refresh and returns the existing BatchResult (no reload, no runner).
  • Batch.poll(interval=60, on_update=None, until=None, max_polls=None, timeout=None, stop_when_complete=True, raise_errors=False, sleep=None, **update_kwargs): repeats refresh; on a changed tick rebuilds summaries, recomputes the QC report() into b.last_report, and calls on_update(batch, outcome). Same PollStatus and stop conditions as cellpy.utils.live.poll; Ctrl-C stops cleanly.

Tests

tests/test_batch_live.py (6 essential) on a from_cells batch of two truncated neware copies with a fake clock growing them on chosen ticks.

uv run pytest -m essential: 953 passed, 74 skipped.

Docs

docs/agents/index.md (batch recipe), root AGENTS.md, .issueflows/04-designs-and-guides/incremental-load-protocol.md, HISTORY.md, test registry.

Made with Cursor

Base automatically changed from 781-live-poll to master September 26, 2026 07:49
jepegit and others added 2 commits September 26, 2026 09:53
refresh() calls CellpyCell.update() on the loaded cells and clears the
combined-summary cache when any changed; poll() repeats it on an interval,
rebuilding summaries and the QC report on changed ticks. Rides on the
cell-level update(); no new core API.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@jepegit
jepegit merged commit efd7fd5 into master Sep 26, 2026
6 checks passed
@jepegit
jepegit deleted the 782-batch-live branch September 26, 2026 07: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.

L5: batch live refresh — b.update(live=True) / b.poll()

1 participant