Use HeadersJournal attributes for journal-page column lookups (#537)#541
Merged
Conversation
The string-keyed hdr_journal["mass"]-style subscripts in batch_plotters.py (create_legend, look_up_group) and helpers.py (add_areal_capacity) become attribute access (hdr_journal.mass, ...). This removes the last HeadersJournal-family hard-coded literals flagged by the scan tool, so a journal-header rename touches the header class only - a native-headers Phase-0 prerequisite. Behavior is byte-identical (the dataclass exposes the same value via attribute and subscript). Closes #537 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.
Summary
Native-headers Phase-0 prerequisite (hardcoded-column-headers-report §8 P1 / §6). Removes the last
HeadersJournal-family hard-coded literals flagged by.issueflows/00-tools/scan_hardcoded_headers.py: the string-keyedhdr_journal["mass"]-style subscripts become attribute access.Real scope turned out to be 6 findings on 3 lines (the issue's table showed all-family counts; only the journal subset is in scope here — raw/steps/summary literals in the same files are #538):
cellpy/utils/batch_tools/batch_plotters.py—create_legend(mass/loading/label),look_up_group(group/sub_group)cellpy/utils/helpers.py—add_areal_capacity(loading)hdr_journalis already imported in both files;HeadersJournalexposes each name via attribute and subscript with the identical value, so behavior is byte-identical.Test plan
HeadersJournalfindings for both files aftertests/test_batch.py+tests/test_helpers.py: 58 passeddriver lock request failedsetup flake ontest_has_no_full_duplicates, unrelated — passes in isolation)full (linux / uv)on this PR is the authoritative post-edit gateCloses #537
🤖 Generated with Claude Code