#591: ICA direction is cell-centric; ica_collector migrates to the specced frame - #598
Merged
Conversation
Maintainer decision (2026-07-20): the specced ICA/DVA frame's direction column is **cell-centric** - "charge" means the cell charging, agreeing with get_ccap/get_dcap and the summary's charge/discharge columns. One convention across the whole API; the electrode-centric reading is derivable by swapping labels when cycle_mode == "anode". Documented at the definition site in cellpy/ica.py. With the convention settled, the deferred half of #566's Phase 3 lands: - `ica_collector` now collects the specced frame (cycle, direction, voltage, capacity, dqdv + the deprecated dq duplicate) via ica.dqdv, instead of the 1.x frame via the private _dqdv_combined_frame. label_direction is a documented no-op (the frame always carries direction). - The film-mode direction filter is extracted to _select_direction, which handles both encodings the plotters actually see: specced string frames match on the label; raw get_cap frames still carry the positional +-1 code and keep the historical -1 -> "charge" selection, because relabelling a positional code needs cycle_mode, which a collected frame no longer knows. - ica_plotter draws the spec-named `dqdv` column instead of the deprecated `dq` alias. - The private _dqdv_combined_frame re-export in cellpy.utils.ica (added solely for the collector) is gone. User-visible: for anode cells, batch ICA film plots labelled "charge" now show the cell charge - the branch that was labelled "discharge" before. The labels were electrode-centric until now; release-noted on #572. Tests: collector output columns + string directions pinned, film mode runs end-to-end, _select_direction covered for both encodings and the no-column case. Full suite 1116 passed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
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. |
5 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 #591. Executes the maintainer decision (2026-07-20): option (a), cell-centric.
The convention
directionin the specced ICA/DVA frame means the cell's direction: "charge" is the cell charging, agreeing withget_ccap/get_dcapand the summary's charge/discharge columns — one convention across the whole API. The electrode-centric reading (lithiating the anode as "charging the electrode") is derivable by swapping labels whencycle_mode == "anode". Documented at the definition site incellpy/ica.py.What lands with it
The half of #566's Phase 3 that this decision was blocking:
ica_collectorcollects the specced frame (cycle, direction, voltage, capacity, dqdv+ the deprecateddqduplicate) viaica.dqdv, instead of the 1.x frame via the private legacy builder.label_directionis a documented no-op._select_direction, handling both encodings the plotters actually see: specced frames match on the string; rawget_capframes still carry the positional ±1 code and keep the historical-1 → "charge"selection — relabelling a positional code needscycle_mode, which a collected frame no longer knows.ica_plotterdraws the spec-nameddqdvcolumn instead of the deprecateddqalias.User-visible change (release-noted on #572)
For anode cells, batch ICA film plots labelled "charge" now show the cell charge — the branch previously labelled "discharge". The labels were electrode-centric until now; with cell-centric chosen, they flip once and then agree with everything else in cellpy.
Tests
Collector output columns and string directions pinned; film mode runs end-to-end on the batch fixture;
_select_directioncovered for both encodings and the missing-column case. Full suite: 1116 passed.🤖 Generated with Claude Code