Add CellpyCell.update() to refresh a cell from a grown raw source - #1102
Merged
Merged
Conversation
Keep the stage-2 halt notes locally. This replaces the leftover #1074 auto status in the same file. Co-authored-by: Cursor <cursoragent@cursor.com>
arbin_res, arbin_sql, neware_txt, and maccor_txt now match the optional SupportsIncrementalLoad protocol. Each returns the harmonized rows read since a LoadMarker and the next marker. The marker rewinds to the first row of the last cycle read, because harmonize's reset-granularity normalisation rebases each cycle against its first row; a mid-cycle chunk would be rebased against the wrong row. Text loaders seek by data row (row_count), arbin by Data_Point (last_source_datapoint_num) through the existing data_points filter (.res) or one extra WHERE clause (SQL Server). Other loaders stay full-read. Tests cover protocol membership, chunk equality with a full harmonize(parse()) read, marker rewind, the empty past-the-end chunk, parse-cache hygiene, and the #778 equality oracle driven by a real chunk. Closes #780 Co-authored-by: Cursor <cursoragent@cursor.com>
…#164) Change detection from file size/mtime, incremental append through load_since + cellpycore update_core_data for arbin_res, arbin_sql, neware_txt and maccor_txt, and a full-reload fallback that keeps cell metadata. Works on cells loaded from a cellpy-file. The #778 test oracle now delegates to the shipped engine. Co-authored-by: Cursor <cursoragent@cursor.com>
jepegit
enabled auto-merge (squash)
September 26, 2026 07:35
jepegit
disabled auto-merge
September 26, 2026 07:38
10 of 21 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #164. Epic #783 (Stage 2, L3). Stacked on #1101 (
780-load-since); retarget tomasteronce that merges.What
CellpyCell.update(force=False, **loader_kwargs) -> boolrefreshes a cell whose raw source is still being written.FileIDsize/mtime against the storedraw_data_files; database sources always count as changed. Unchanged →False, no work.SupportsIncrementalLoad: arbin_res, arbin_sql, neware_txt, maccor_txt): derive aLoadMarkerfrom the loaded raw (rewound to the last cycle start, both seek fields filled),load_since, stamptest_id, align dtypes, thencore.update_core_data+ summary extras + scaled columns.meta_common(mass, area, nominal capacity),cycle_mode,cell_name.data._provenance["source_type"];**loader_kwargs(e.g.model="UIO") forwarded toset_instrument.FileIDstats,last_data_point, andraw_data_files_lengthrefreshed after each update.tests/incremental_support.incremental_update(the L6: golden equality test — incremental update() == full load #778 oracle) now delegates toCellpyCell._update_from_raw_rows.Tests
tests/test_cell_update.py(9 essential): no-op, growth == fullcellpy.get, two growths, FileID refresh, cellpy-file round trip, single-cycle fallback keeps meta,force, no source raises, non-incremental loader routes to full reload.uv run pytest -m essential: 939 passed, 74 skipped.Docs
.issueflows/04-designs-and-guides/incremental-load-protocol.md(#164 section),docs/agents/index.md, rootAGENTS.mdquick facts,HISTORY.md, test registry.Made with Cursor