Skip to content

C1: refactor ocv_rlx onto native schema + fix the self.data trap (#709) - #739

Merged
jepegit merged 1 commit into
masterfrom
709-ocv-rlx-wave3
Jul 27, 2026
Merged

C1: refactor ocv_rlx onto native schema + fix the self.data trap (#709)#739
jepegit merged 1 commit into
masterfrom
709-ocv-rlx-wave3

Conversation

@jepegit

@jepegit jepegit commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Epic C, arc C1 (#709) — utils wave 3: ocv_rlx

Refactors cellpy/utils/ocv_rlx.py onto native schema headers and fixes the long-standing self.data-holds-a-CellpyCell trap. The scipy/lmfit fitting (OcvFit, the model, the translated parameters) stays app-side, unchanged.

Native header access (#709, ahead of E3)

select_ocv_points, MultiCycleOcvFit, and OcvFit.set_cellpydata now read column names from cell.schema (schema.raw, schema.steps) instead of the deprecated headers_normal / headers_step_table singletons (removed in 2.1). Step-table statistic columns build on the native raw base names (potential/current/step_time + _first/_last/_delta). The module-level get_headers_* singletons are gone.

The self.data trap

MultiCycleOcvFit held the CellpyCell as .data, producing the confusing self.data.data.steps double-.data. It's now .cell (→ self.cell.data.steps). .data (property) and set_data() remain as deprecation aliases (warn_once, removal 2.2) for .cell / set_cell().

Verification

Numerically identical — test_ocv_relax's r0 == 12.15126 fit guard holds. Added tests for the rename + deprecated aliases (6 passed). select_ocv_points signature/output unchanged, so batch_analyzers keeps working.

Closes #709

…(C1, #709)

Utils wave 3 for ocv_rlx (scipy/lmfit fitting stays app-side, unchanged):

- Native header access: select_ocv_points / MultiCycleOcvFit / OcvFit now read
  column names from cell.schema (schema.raw, schema.steps) instead of the
  deprecated headers_normal / headers_step_table singletons (removed in 2.1,
  E3). Step-table statistic columns build on the native raw base names
  (potential/current/step_time + _first/_last/_delta). Dropped the module-level
  get_headers_* singletons entirely.
- Ended the self.data-holds-a-CellpyCell trap: MultiCycleOcvFit holds the cell
  as `.cell` (was `.data`, which produced the confusing `self.data.data.steps`
  double-.data). `.data` property and `set_data()` stay as deprecation aliases
  (warn_once, removal 2.2) for `.cell` / `set_cell()`.

Verified numerically identical (test_ocv_relax's r0==12.15126 fit guard holds);
added tests for the rename + deprecated aliases. select_ocv_points signature
and output unchanged, so batch_analyzers keeps working.

Closes #709

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 27, 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 enabled auto-merge (squash) July 27, 2026 07:57
@jepegit
jepegit merged commit 2071301 into master Jul 27, 2026
5 of 6 checks passed
@jepegit
jepegit deleted the 709-ocv-rlx-wave3 branch July 27, 2026 07:59
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.

C1: utils wave 3 — ocv_rlx port/refactor

1 participant