E3 (runtime part 2): migrate headers_* resolvers to native (#715) - #745
Merged
Conversation
Second slice of the headers_* -> schema.* runtime migration: the assign-to-variable and family-resolver patterns (hdr = c.headers_summary; hdr.<legacy_attr>). Scoping stayed small because most hdr_summary/hdr_steps usage is the module-level get_headers_* singleton (not deprecated) -- only the functions that shadow with cell.headers_* are the shim. Migrated: - utils/helpers.py: select_summary_based_on_rate -> cell.schema.steps / cell.schema.summary (c_rate/step_type/cycle_num). - readers/capacity_curves.py: get_ocv step lookup -> cell.schema.steps. - plotting/registry.py: the summary family resolvers now use native attr names (charge_capacity_raw->charge_capacity, cumulated_discharge_capacity_loss-> test_cumulated_discharge_capacity_loss, end_voltage_*->potential_end_*). - plotting/prepare/summary.py + utils/plotutils.py: hdr = c.schema.summary, downstream attrs renamed to native (cycle_index->cycle_num, data_point-> datapoint_num_last, test_time->last_test_time, datetime->"date_time"). - plotting/context.py: removed the deprecated headers_summary passthrough property (no consumers remain). All native names resolved via the runtime shim (behaviour-preserving). Verified: test_figure_specs / test_plotutils_headers / test_ocv_relax / test_cv_partition -> 89 passed. Deferred: exporters/bdf.py keeps the shim for now -- its _COLUMN_MAP is keyed by legacy `_txt` field names via getattr(headers, spec.cellpy_field), so it needs a dedicated map->native migration (its own follow-up). Once bdf.py lands, the shim properties can be removed (the final E3 PR). Refs #715 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
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
enabled auto-merge (squash)
July 27, 2026 10:57
2 tasks
jepegit
added a commit
that referenced
this pull request
Jul 27, 2026
The per-instance `headers_normal` / `headers_summary` / `headers_step_table` attributes were a 2.0 deprecation shim (LegacyHeaderShim) mapping legacy `*_txt` attribute access to native cellpycore column names. The runtime was migrated off the shim in 2.1 (parts 1-3, #744/#745/#746); this removes the shim itself on both the native and legacy-bridge paths per the full-removal decision. - delete `cellpy/parameters/legacy_header_shim.py` (+ its test) - drop the shim wiring block from `CellpyCell.__init__` (both branches) - drop the shim's pending-deprecation seed; regenerate DEPRECATIONS.md - migrate the remaining `c.headers_*` accesses to `c.schema.raw/steps/summary` across tests and the maccor/custom `__main__` demo blocks; legacy-only step columns (`info`) become literals, and legacy-singleton usages keep `*_txt` - rewrite the shim tests in test_cell_schema.py as a shim-removed assertion `c.schema.raw` / `c.schema.steps` / `c.schema.summary` is the replacement. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Epic E, arc E3 — runtime migration, part 2
Second slice of
headers_* → schema.*: the assign-to-variable and family-resolver patterns (hdr = c.headers_summary; hdr.<legacy_attr>). Scope stayed small because mosthdr_summary/hdr_stepsusage is the module-levelget_headers_*singleton (not deprecated) — only the functions that shadow withcell.headers_*are the shim.Migrated
utils/helpers.py—select_summary_based_on_rate→cell.schema.steps/cell.schema.summary.readers/capacity_curves.py—get_ocvstep lookup →cell.schema.steps.plotting/registry.py— the summary family resolvers use native attr names (charge_capacity_raw→charge_capacity,cumulated_discharge_capacity_loss→test_cumulated_discharge_capacity_loss,end_voltage_*→potential_end_*).plotting/prepare/summary.py+utils/plotutils.py—hdr = c.schema.summary; downstream attrs renamed to native (cycle_index→cycle_num,data_point→datapoint_num_last,test_time→last_test_time,datetime→"date_time").plotting/context.py— removed the deprecatedheaders_summarypassthrough property (no consumers remain).Every native name was resolved via the runtime shim, so behaviour is preserved. Verified:
test_figure_specs/test_plotutils_headers/test_ocv_relax/test_cv_partition→ 89 passed.Deferred
exporters/bdf.pykeeps the shim for now — its_COLUMN_MAPis keyed by legacy_txtfield names viagetattr(headers, spec.cellpy_field), so it needs a dedicated map→native migration (a small follow-up). Once bdf.py lands, the shim properties can be removed (the final E3 PR).Refs #715