feat(cellpy_file): dormant native⇄legacy frame translation (Stage 1.15, #458)#500
Merged
Conversation
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>
|
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. |
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.


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 intocellpy_file.load); the tests are what keep it honest until then. All header knowledge comes fromcellpycore.legacy.mapping— nothing declared locally.raw/steps/summary_to_native/_to_legacy(summary includes the{col}_{mode}specific variants viaexpand_specific_columns); renames only touch columns present.to_nativeinjectstest_id = 0where absent (native composite group keys, D3);to_legacystrips it from steps/summary again — v8 → native → v8 is exact (columns, order, dtypes, values).classify_legacy_columnstotality 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'sindex-column sort quirk on steps (plan D4) andshifted_*_{gravimetric,areal}variants in old files (legacyspecific_columnsincluded the shifted capacities).Deliberately not in this dormant layer (Phase-3 importer concerns, per the plan):
date_time→epoch_time_utcderivation 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