Skip to content

#591: ICA direction is cell-centric; ica_collector migrates to the specced frame - #598

Merged
jepegit merged 1 commit into
masterfrom
issue-591-ica-direction
Jul 19, 2026
Merged

#591: ICA direction is cell-centric; ica_collector migrates to the specced frame#598
jepegit merged 1 commit into
masterfrom
issue-591-ica-direction

Conversation

@jepegit

@jepegit jepegit commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Closes #591. Executes the maintainer decision (2026-07-20): option (a), cell-centric.

The convention

direction in the specced ICA/DVA frame means the cell's direction: "charge" is 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 (lithiating the anode as "charging the electrode") is derivable by swapping labels when cycle_mode == "anode". Documented at the definition site in cellpy/ica.py.

What lands with it

The half of #566's Phase 3 that this decision was blocking:

  • ica_collector 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 legacy builder. label_direction is a documented no-op.
  • The film-mode direction filter is extracted to _select_direction, handling both encodings the plotters actually see: specced frames match on the string; raw get_cap frames still carry the positional ±1 code and keep the historical -1 → "charge" selection — 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.

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_direction covered for both encodings and the missing-column case. Full suite: 1116 passed.

🤖 Generated with Claude Code

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>
@cursor

cursor Bot commented Jul 19, 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 777901b into master Jul 19, 2026
5 checks passed
@jepegit
jepegit deleted the issue-591-ica-direction branch July 19, 2026 23:17
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.

Decide the direction convention for the ICA/DVA output frame (cell-centric vs electrode-centric)

1 participant