Skip to content

Use HeadersJournal attributes for journal-page column lookups (#537)#541

Merged
jepegit merged 1 commit into
masterfrom
537-journal-header-literals
Jul 17, 2026
Merged

Use HeadersJournal attributes for journal-page column lookups (#537)#541
jepegit merged 1 commit into
masterfrom
537-journal-header-literals

Conversation

@jepegit

@jepegit jepegit commented Jul 17, 2026

Copy link
Copy Markdown
Owner

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-keyed hdr_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.pycreate_legend (mass/loading/label), look_up_group (group/sub_group)
  • cellpy/utils/helpers.pyadd_areal_capacity (loading)

hdr_journal is already imported in both files; HeadersJournal exposes each name via attribute and subscript with the identical value, so behavior is byte-identical.

Test plan

  • Scan tool reports 0 HeadersJournal findings for both files after
  • tests/test_batch.py + tests/test_helpers.py: 58 passed
  • Full-suite baseline green (668 passed; one Windows-only HDF5 driver lock request failed setup flake on test_has_no_full_duplicates, unrelated — passes in isolation)
  • ruff: no new findings vs master
  • full (linux / uv) on this PR is the authoritative post-edit gate

Closes #537

🤖 Generated with Claude Code

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>
@cursor

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

@jepegit
jepegit merged commit a2d090c into master Jul 17, 2026
5 checks passed
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.

v2 pre-flip: replace hardcoded journal-page column literals with HeadersJournal

1 participant