Skip to content

Adapt namelist parameter case to match aiida-quantumespresso v5 - #95

Merged
elinscott merged 2 commits into
aiidateam:mainfrom
elinscott:fix-aiida-qe-4.15-casing
Aug 14, 2026
Merged

Adapt namelist parameter case to match aiida-quantumespresso v5#95
elinscott merged 2 commits into
aiidateam:mainfrom
elinscott:fix-aiida-qe-4.15-casing

Conversation

@elinscott

@elinscott elinscott commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Problem

main fails CI becasue aiida-quantumespresso 4.15 introduced a consistent casing convention for CalcJob parameters input: namelist keys must be UPPERCASE and parameter keys lowercase, and unstored Dict nodes are auto-corrected in place with a warning. This surfaced two failure modes in this package.

  • First, real KeyErrors at runtime — code that read parameters.get_dict()["inputpp"] crashed because the validator had already normalized the node to INPUTPP
  • Second, pytest-regressions snapshot mismatches across every protocol builder test — obtained INPUTPP/deltae vs stored inputpp/DeltaE

Change

Adapt the package to emit and read the canonical casing throughout.

  • Protocol YAMLs now use INPUTPP (base pw2wannier90.yaml, overrides/wannier90.yaml) and lowercase deltae (base projwfc.yaml).
  • The source reads/writes the pw2wannier90 QE namelist as INPUTPP everywhere
  • Test code and fixtures use the INPUTPP/PROJWFC namelist keys so that shared unstored fixture Dict nodes are not mutated out from under the subsequent reads
  • The affected pytest-regressions snapshots are regenerated.

Testing

uv pip install -e ".[tests]" aiida-quantumespresso==4.15.0 in an isolated Python 3.11 venv.

  • Before the change: 59 failed, 102 passed.
  • After the change (pytest tests/): 161 passed, 0 failed.

The full suite was additionally run against aiida-quantumespresso 5.0.0 (which hard-enforces the convention): also 161 passed, 0 failed.

Snapshots were regenerated with pytest --force-regen and the full suite reruns clean.

Fixes #90

aiida-quantumespresso 4.15.0 enforces a consistent casing convention on
CalcJob `parameters` inputs (`validate_parameters`): namelist keys must be
UPPERCASE and parameter keys lowercase, and unstored Dict nodes are
auto-corrected in place. This broke the package against 4.15: code reading
`parameters.get_dict()["inputpp"]` raised KeyError because the node had been
normalized to `INPUTPP`, and every protocol builder snapshot mismatched
(`inputpp`->`INPUTPP`, `DeltaE`->`deltae`).

Adapt the package to emit and read the canonical casing:
- Protocol YAMLs: `inputpp`->`INPUTPP`, `DeltaE`->`deltae`.
- Source: read/write the QE pw2wannier90 namelist as `INPUTPP` throughout
  (base/pw2wannier90.py, wannier90.py, split.py, plot/bands.py).
- Tests/fixtures: use `INPUTPP`/`PROJWFC` namelist keys so shared fixture
  nodes are not mutated out from under the test reads.
- Regenerate the affected pytest-regressions snapshots; diffs are
  casing-only (no value changes).

Alternative considered: upper-pinning aiida-quantumespresso <4.15. Rejected
in favor of adapting to the new convention.

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

elinscott commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

Note that this overlaps with #91 but additionally fixes DeltaE -> deltae

@elinscott

Copy link
Copy Markdown
Collaborator Author

@qiaojunfeng

@elinscott elinscott changed the title Adapt namelist parameter case to match aiida-quantumespresso 4.15 Adapt namelist parameter case to match aiida-quantumespresso v5 Aug 14, 2026
@elinscott
elinscott merged commit eec7aa5 into aiidateam:main Aug 14, 2026
8 checks passed
@aiida-cla-bot aiida-cla-bot Bot locked and limited conversation to collaborators Aug 14, 2026
@elinscott
elinscott deleted the fix-aiida-qe-4.15-casing branch August 14, 2026 15:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incompatibility with uppercase INPUTPP

1 participant