Skip to content

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

Description

@jepegit

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    v2cellpy v2 work - PRs should target the master branch

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions