Skip to content

Use cellpycore StepType vocabulary for step-type literals (#543)#545

Merged
jepegit merged 1 commit into
masterfrom
543-step-type-constants
Jul 17, 2026
Merged

Use cellpycore StepType vocabulary for step-type literals (#543)#545
jepegit merged 1 commit into
masterfrom
543-step-type-constants

Conversation

@jepegit

@jepegit jepegit commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Native-headers Phase-0 prerequisite, split from #538 (where the header scan flagged step-type values as false positives — they're compared against the step-table type column, not header columns).

  • cellreader.pylist_of_step_types was a hand-maintained duplicate of the 13 step-type names; now list(config.STEP_TYPES) (single source, exact match verified).
  • utils/ocv_rlx.pystep_table[hdr_steps.type].isin(["discharge"]) / (["charge"]) (4 sites) → StepType.DISCHARGE.value / .CHARGE.value.
  • utils/helpers.py — the on = ["charge"] step-type filter default → [StepType.CHARGE.value].

Behavior-identical (StepType.<X>.value equals the former literal).

Out of scope (deliberately): direction == "charge" / cap_type == "charge" comparisons (those compare API arguments / local direction variables, not the step-table type column), and easyplot (deprecated, removal 2.0 — #544).

Test plan

  • list_of_step_types == list(STEP_TYPES) verified
  • test_ocv_relax.py + test_helpers.py + test_cell_readers.py: 120 passed
  • No step-type isin literals remain in ocv_rlx
  • ruff: no new findings
  • full (linux / uv) is the authoritative gate

Closes #543

🤖 Generated with Claude Code

Native-headers Phase-0 prerequisite (split from #538, where the header
scan flagged step-type values as false positives).

- cellreader.py: list_of_step_types was a hand-maintained duplicate of the
  13 step-type names; it is now list(config.STEP_TYPES) (single source).
- utils/ocv_rlx.py: the step-table type comparisons
  step_table[hdr_steps.type].isin(["discharge"]) / (["charge"]) use
  StepType.DISCHARGE.value / StepType.CHARGE.value.
- utils/helpers.py: the on=["charge"] step-type filter default uses
  StepType.CHARGE.value.

Behavior-identical (StepType.<X>.value equals the former literal). Out of
scope: direction/cap_type == "charge" comparisons (API arguments, not the
step-table type column) and easyplot (deprecated, removal 2.0 - #544).

Closes #543

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 17, 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 ee0ad15 into master Jul 17, 2026
5 checks passed
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.

v2 pre-flip: replace hardcoded step-type string literals with cellpycore StepType constants

1 participant