Problem
collect_summaries / collect_cycles are exactly what an app wants, but they only
accept a batch exposing .cells ({label: CellpyCell}) and .journal.pages
(a polars frame with filename / group / sub_group / group_label /
label / selected). There is no public way to build that from a set of
already-loaded CellpyCell objects (e.g. cells a GUI is holding in memory, some
loaded from raw files, some from .cellpy files).
I had to reverse-engineer the contract and duck-type a shim. Two things only
surfaced at runtime:
collect_summaries also reads batch.journal.name (undocumented; AttributeError
if missing).
pages must be polars (.iter_rows(named=True), .columns), and the
filename key must match the batch.cells keys.
Suggestion
A supported constructor, e.g.:
collection = cellpy.collect.from_cells(
cells, # list or {label: CellpyCell}
groups={label: 1, ...}, # optional
selected={label: True, ...}, # optional
)
# or Batch.from_cells(...)
This is probably the single biggest enabler for GUIs / notebooks that manage cells
in memory rather than from a journal on disk.
Found while building cellpy-simple-gui on cellpy 2.1.0.post1. Full write-up with all items: CELLPY_PAINPOINTS.md.
Problem
collect_summaries/collect_cyclesare exactly what an app wants, but they onlyaccept a
batchexposing.cells({label: CellpyCell}) and.journal.pages(a polars frame with
filename/group/sub_group/group_label/label/selected). There is no public way to build that from a set ofalready-loaded
CellpyCellobjects (e.g. cells a GUI is holding in memory, someloaded from raw files, some from
.cellpyfiles).I had to reverse-engineer the contract and duck-type a shim. Two things only
surfaced at runtime:
collect_summariesalso readsbatch.journal.name(undocumented;AttributeErrorif missing).
pagesmust be polars (.iter_rows(named=True),.columns), and thefilenamekey must match thebatch.cellskeys.Suggestion
A supported constructor, e.g.:
This is probably the single biggest enabler for GUIs / notebooks that manage cells
in memory rather than from a journal on disk.
Found while building cellpy-simple-gui on cellpy 2.1.0.post1. Full write-up with all items: CELLPY_PAINPOINTS.md.