Skip to content

feat(cellpy_file): dormant native⇄legacy frame translation (Stage 1.15, #458)#500

Merged
jepegit merged 1 commit into
masterfrom
458-translate-dormant
Jul 15, 2026
Merged

feat(cellpy_file): dormant native⇄legacy frame translation (Stage 1.15, #458)#500
jepegit merged 1 commit into
masterfrom
458-translate-dormant

Conversation

@jepegit

@jepegit jepegit commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Closes #458 (Stage 1.15 / native-headers plan Phase 1). Consumes the core#116 mapping extensions shipped in cellpycore 0.2.0.

cellpy/readers/cellpy_file/translate.py — the translate-once-at-I/O layer the cellpy 2 flip will run instead of the per-call rename sandwich. Dormant on v1.x (nothing calls it at runtime until Phase 3 wires it into cellpy_file.load); the tests are what keep it honest until then. All header knowledge comes from cellpycore.legacy.mapping — nothing declared locally.

  • Frame-level raw/steps/summary_to_native / _to_legacy (summary includes the {col}_{mode} specific variants via expand_specific_columns); renames only touch columns present.
  • Data-level to_native injects test_id = 0 where absent (native composite group keys, D3); to_legacy strips it from steps/summary again — v8 → native → v8 is exact (columns, order, dtypes, values).
  • classify_legacy_columns totality guard: every column in a v8 file must be mapped or documented legacy-only; unknown fails. It surfaced two real quirks on the golden file, now documented classifications: the bridge's index-column sort quirk on steps (plan D4) and shifted_*_{gravimetric,areal} variants in old files (legacy specific_columns included the shifted capacities).
  • The Stage-0 Stage 0.7: Value-parity comparator — the mapped-columns oracle harness #434 value-parity comparator is green between the legacy frames and their translated native twins for all three families.

Deliberately not in this dormant layer (Phase-3 importer concerns, per the plan): date_timeepoch_time_utc derivation and the drop-and-recompute policy for summary cruft.

Full suite: 592 passed, 0 failed. This closes the last open Stage-1 work item.

🤖 Generated with Claude Code

Native-headers plan Phase 1 (Stage 1.15). translate.py builds entirely
on cellpycore.legacy.mapping (core#116, cellpycore 0.2.0) - no header
knowledge is declared locally:

- raw/steps/summary to_native/to_legacy frame translators (summary
  renames include the {col}_{mode} specific variants via
  expand_specific_columns); only columns present are touched
- Data-level to_native injects test_id = 0 where absent (native
  composite group keys, D3); to_legacy strips it from steps/summary so
  the v8 -> native -> v8 round trip is exact
- classify_legacy_columns totality guard; it surfaced two real quirks,
  now documented classifications: the bridge's index-column sort quirk
  on steps (D4) and legacy-only shifted_* specific variants in old
  files (legacy specific_columns included the shifted capacities)

Dormant on v1.x: nothing calls it at runtime until the Phase-3 flip
wires it into cellpy_file.load. Guards: exact round-trip, totality
(unknown column fails), #434 value-parity comparator green per family.

Full suite: 592 passed.

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

cursor Bot commented Jul 15, 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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: essential and benchmark CI checks passed. Cursor Bugbot was not present on this PR; no applicable approval policies required human review. No reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@jepegit
jepegit merged commit cd11859 into master Jul 15, 2026
4 checks passed
@jepegit
jepegit deleted the 458-translate-dormant branch July 15, 2026 07:26
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.

Stage 1.15: translate.py — dormant native⇄legacy frame translation in cellpy_file/

1 participant