Skip to content

Nexus: replace optparse in __init__.py with argparse - #6211

Open
brockdyer03 wants to merge 1 commit into
QMCPACK:developfrom
brockdyer03:replace-optparse
Open

Nexus: replace optparse in __init__.py with argparse#6211
brockdyer03 wants to merge 1 commit into
QMCPACK:developfrom
brockdyer03:replace-optparse

Conversation

@brockdyer03

Copy link
Copy Markdown
Contributor

Proposed changes

Python's optparse module is very outdated and requires a significant amount of extra work to do the same thing as argparse. In this PR I have updated the main __init__.py of Nexus to use argparse instead of optparse, and have organized and trimmed down the code for handling command line arguments, as well as added options for common/convenient aliases of some command line arguments.

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

  • 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 44 (KDE Plasma Desktop Edition)
AMD Ryzen 7 PRO 7840U (8 cores, 16 logical processors)

Python        3.14.6
uv            0.12.5
cif2cell      2.1.0
coverage      7.15.4
h5py          3.16.0
matplotlib    3.11.1
numpy         2.5.2
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)

@github-actions github-actions Bot added nexus python Pull requests that update python code labels Sep 7, 2026

@jtkrogel jtkrogel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need time to look

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

Labels

nexus python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants