Part of Stage 1 — behavior-preserving construction (see the Stage-1 tracking issue). Stage 0: jepegit/cellpy#439. Plan documents live in the shared workspace: cellpy-workspace/architecture-plan/ (the architecture-plan repo; formerly architecture-plan/) (alongside the cellpy and cellpy-core repos). Everything in Stage 1 lands on master with the full suite green; nothing flips user-visible behavior.
Goal
Two additive pieces in cellpycore.legacy.mapping:
expand_specific_columns(rename, modes) — the {col}_{gravimetric|areal|absolute}
postfix expansion currently inlined in OldCellpyCellCore.add_scaled_summary_columns
(cell_core.py:1086–1092), lifted so the bridge and the future file-importer share it.
LEGACY_ATTR_TO_SCHEMA — attribute-level table (legacy attribute name → native
schema path, e.g. voltage_txt → raw.potential), needed because the value-based
mapping cannot serve the accessor shim; ~60 attributes cover everything the utils use.
Handle the duplicate-value pair (HeadersSummary.discharge_capacity vs
discharge_capacity_raw) explicitly.
Why
cellpy's translate.py (Stage 1.15) and later the deprecation shim consume these; the
mapping module stays the single source of truth (no header knowledge re-appears in the
bridge or the importer). Same totality-test discipline as the existing tables: an
uncategorized attribute fails the build.
Links (workspace)
architecture-plan/cellpy2-native-headers-migration-plan.md (Phase 1, D6)
architecture-plan/legacy-cellpy-core-header-swapping.md (mapping guarantees)
Acceptance
- Totality + bijectivity tests extended; bridge re-pointed at
expand_specific_columns
with byte-identical goldens; release tagged for cellpy re-pin.
Goal
Two additive pieces in
cellpycore.legacy.mapping:expand_specific_columns(rename, modes)— the{col}_{gravimetric|areal|absolute}postfix expansion currently inlined in
OldCellpyCellCore.add_scaled_summary_columns(cell_core.py:1086–1092), lifted so the bridge and the future file-importer share it.
LEGACY_ATTR_TO_SCHEMA— attribute-level table (legacy attribute name → nativeschema path, e.g.
voltage_txt → raw.potential), needed because the value-basedmapping cannot serve the accessor shim; ~60 attributes cover everything the utils use.
Handle the duplicate-value pair (
HeadersSummary.discharge_capacityvsdischarge_capacity_raw) explicitly.Why
cellpy's
translate.py(Stage 1.15) and later the deprecation shim consume these; themapping module stays the single source of truth (no header knowledge re-appears in the
bridge or the importer). Same totality-test discipline as the existing tables: an
uncategorized attribute fails the build.
Links (workspace)
architecture-plan/cellpy2-native-headers-migration-plan.md(Phase 1, D6)architecture-plan/legacy-cellpy-core-header-swapping.md(mapping guarantees)Acceptance
expand_specific_columnswith byte-identical goldens; release tagged for cellpy re-pin.