Skip to content

Nexus: Add code to automatically generate the input parameters for QE's pw.x - #6049

Draft
brockdyer03 wants to merge 4 commits into
QMCPACK:developfrom
brockdyer03:pwscf-input-autogen
Draft

Nexus: Add code to automatically generate the input parameters for QE's pw.x#6049
brockdyer03 wants to merge 4 commits into
QMCPACK:developfrom
brockdyer03:pwscf-input-autogen

Conversation

@brockdyer03

Copy link
Copy Markdown
Contributor

Proposed changes

This PR adds a new developer script to Nexus that has one purpose, to automatically generate enumerations of the input parameter namelists for Quantum ESPRESSO's pw.x code.

The code works off of a tar archive containing XML files generated from QE's INPUT_PW.def files using their supplied helpdoc utility. If someone needs to update the files, it's a simple matter of appending the new file to the archive. The script will then parse all of the parameters in the QE namelists for each version that is included and extract the relevant data. The enumerations that it produces will always contain the follow information:

  • Parameter Name
  • Datatype (one of str, float, int, bool)
  • Whether or not it is required (True/False)

The enumerations will also occasionally contain the following information:

  • Shape of the input (e.g. array dimensions)
  • The allowed values of the input, if there are only a set number of allowed values.
  • The version the parameter was added, if it is greater than the earliest version known.
  • The version the parameter was removed, if it is less than the latest version known.

Remaining work

  • Determine if the included tar archive is allowable vis-à-vis licensing.
  • Integrate the new enums into pwscf_input.py.

What type(s) of changes does this code introduce?

  • New feature
  • Refactoring (no functional changes, no api changes)

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

Laptop, Fedora Linux 43 (KDE Plasma Desktop Edition)
AMD Ryzen 7 PRO 7840U (8 cores, 16 logical processors)

Python        3.14.6
uv            0.11.26
cif2cell      2.1.0
coverage      7.15.0
h5py          3.16.0
matplotlib    3.11.0
numpy         2.5.1
pycifrw       4.4.6
pydot         4.0.1
pytest        9.1.1
pytest-cov    7.1.0
pytest-order  1.5.0
scipy         1.18.0
seekpath      2.2.1
spglib        2.7.0
sphinx        9.1.0

Checklist

    • I have read the pull request guidance and develop docs
    • This PR is up to date with the current state of 'develop'
    • Code added or changed in the PR has been clang-formatted
    • This PR adds tests to cover any new code, or to catch a bug that is being fixed
    • Documentation has been added (if appropriate)

@brockdyer03
brockdyer03 requested a review from jtkrogel July 22, 2026 20:33
@brockdyer03 brockdyer03 self-assigned this Jul 22, 2026
@brockdyer03 brockdyer03 added enhancement nexus cleanup For cleanling legacy lines of code python Pull requests that update python code labels Jul 22, 2026
@prckent

prckent commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Please remove the binary blob (.tar.gz) and add a note in the docs somewhere on how to run this. Include the exact steps you used for the latest QE. That is all that is needed for developers. We aren't going to put this in CI. It will either work or fail spectacularly when e.g. for QE8 they change the format.

@prckent

prckent commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Consider replacing the title "generate" with "add support to Nexus for"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup For cleanling legacy lines of code enhancement nexus python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants