Fallout from #566. Not a bug — a domain decision that the specced frame forces and that 1.x avoided by handing back a raw ±1 code.
The clash
get_cap(categorical_column=True) gives -1 to the first half-cycle of each cycle. Which physical direction that is depends on cycle_mode — for cellpy's default "anode", the first half-cycle is get_dcap, the cell discharge (capacity_curves.py:337-345).
cellpy.ica.dqdv therefore labels -1 as "discharge", agreeing with the get_ccap/get_dcap naming the data came from.
But collectors.ica_plotter selects direction < 0 and titles it "charge" (collectors.py:2136-2140) — the electrode-centric reading, in which lithiating the anode is "charging the electrode" even though the cell is discharging.
Both readings are conventional in the field, and both are in the codebase right now.
Why it needs deciding
Whichever we adopt, the other set of plots gets relabelled. That is why ica_collector was not migrated to the specced frame in #566 — silently inverting the labels on every batch ICA plot is not something to do as a side effect of a refactor. It calls the private 1.x builder for now.
Options
- (a) Cell-centric — current
cellpy.ica behaviour: -1 is "discharge" for an anode cell. Consistent with get_ccap/get_dcap and with the summary columns. ica_plotter's titles flip.
- (b) Electrode-centric — -1 is
"charge" regardless of cycle_mode. Matches what batch users see today. The frame stops agreeing with get_ccap/get_dcap.
- (c) Both — a
direction (cell) column plus an electrode_direction column, and the plotter picks. Costs a column; ends the ambiguity permanently.
Done when
Plan write-up: architecture-plan/cellpy2-ica-redesign-plan.md §6.6.
Fallout from #566. Not a bug — a domain decision that the specced frame forces and that 1.x avoided by handing back a raw ±1 code.
The clash
get_cap(categorical_column=True)gives -1 to the first half-cycle of each cycle. Which physical direction that is depends oncycle_mode— for cellpy's default"anode", the first half-cycle isget_dcap, the cell discharge (capacity_curves.py:337-345).cellpy.ica.dqdvtherefore labels -1 as"discharge", agreeing with theget_ccap/get_dcapnaming the data came from.But
collectors.ica_plotterselectsdirection < 0and titles it "charge" (collectors.py:2136-2140) — the electrode-centric reading, in which lithiating the anode is "charging the electrode" even though the cell is discharging.Both readings are conventional in the field, and both are in the codebase right now.
Why it needs deciding
Whichever we adopt, the other set of plots gets relabelled. That is why
ica_collectorwas not migrated to the specced frame in #566 — silently inverting the labels on every batch ICA plot is not something to do as a side effect of a refactor. It calls the private 1.x builder for now.Options
cellpy.icabehaviour: -1 is"discharge"for an anode cell. Consistent withget_ccap/get_dcapand with the summary columns.ica_plotter's titles flip."charge"regardless ofcycle_mode. Matches what batch users see today. The frame stops agreeing withget_ccap/get_dcap.direction(cell) column plus anelectrode_directioncolumn, and the plotter picks. Costs a column; ends the ambiguity permanently.Done when
ica_collectoris on the specced frame.Plan write-up:
architecture-plan/cellpy2-ica-redesign-plan.md§6.6.