Skip to content

Nexus: update RMG analyzer - #6194

Open
jtkrogel wants to merge 29 commits into
QMCPACK:developfrom
jtkrogel:nx_rmg_analyzer_dev
Open

Nexus: update RMG analyzer#6194
jtkrogel wants to merge 29 commits into
QMCPACK:developfrom
jtkrogel:nx_rmg_analyzer_dev

Conversation

@jtkrogel

@jtkrogel jtkrogel commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

This PR generalizes and hardens the RMG analyzer class. Capabilities are limited to scf, nscf, and relax runs.

Many real input/output files from RMG are included. These are there to support testing here and for the roll-forward.

GPT-5.6 Sol was used

@github-actions github-actions Bot added nexus python Pull requests that update python code labels Sep 1, 2026
@jtkrogel
jtkrogel marked this pull request as draft September 1, 2026 18:35
@prckent

prckent commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

FYI, unless you need it, please don't push every commit since it triggers the GitHub actions CI and might (speculating, but it is logical) rate limit other runs in progress that we need for approved PRs. You can group them, push daily to show progress etc.

@jtkrogel
jtkrogel marked this pull request as ready for review September 1, 2026 21:30
@prckent

prckent commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What are the plans to document the analyzer?

@jtkrogel

jtkrogel commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

See reply to similar comment on #6196

rcclay
rcclay previously approved these changes Sep 2, 2026

@rcclay rcclay 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.

Just some very slight nitpicks. Lots of code, but most of its seems like unobjectionable file parsing and boiler plate stuff.

Comment thread nexus/nexus/rmg_analyzer.py Outdated
stress = self.results.stress
if stress is None:
return None
return stress*1e8/self.pressure_units[units]

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.

Why is there a 1e8, instead of being subsumed into the unit conversion?


all_modes = frozenset({'scf','nscf','relax'})
relaxation_modes = frozenset({'relax'})
pressure_units = MappingProxyType({

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.

Is there any point for supporting eV/A^3, Ha/Bohr^3, Ry/Bohr^3? Not fun units for looking at an output file, but great for enthalpy calculations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed

@brockdyer03 brockdyer03 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.

This is just a partial review since I don't have time to comb through all of the slop that GPT produced.

Overall, this PR has a wide array of problems. Some of the most notable are unnecessary checks, unnecessary code flexibility, poor efficiency (the entire file is stored into memory and iterated over in its entirety several times), poor formatting.

Additionally due to its heavy use of obj for the attributes of RmgOutputData, is nearly impossible to document the class automatically, thus meaning that future developers will need to either pray that the code was well-documented manually and then need to constantly update the docs as they update the code, or sift through the source to figure out what everything is supposed to be.

There are formatting issues with nearly every docstring in the file too that should be addressed.

Another problem is that basically every read class silently ignores invalid parts of the file, which can lead to a lot of challenges if there needs to be any debugging of a failed analysis.

Comment thread nexus/nexus/rmg_analyzer.py Outdated
Comment thread nexus/nexus/rmg_analyzer.py
Comment thread nexus/nexus/rmg_analyzer.py Outdated
Comment thread nexus/nexus/rmg_analyzer.py
Comment thread nexus/nexus/rmg_analyzer.py Outdated
Comment thread nexus/nexus/rmg_analyzer.py
Comment thread nexus/nexus/rmg_analyzer.py Outdated
Comment thread nexus/nexus/rmg_analyzer.py Outdated
Comment thread nexus/nexus/rmg_analyzer.py
Comment thread nexus/nexus/rmg_analyzer.py Outdated
@jtkrogel

jtkrogel commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@brockdyer03 please don't be perjorative (i.e. "slop"). I spent many passes creating and vetting this code, and it is similar to what I would write. If you inspect the prior PwscfAnalyzer, the current code has fewer issues of the types you raise.

@jtkrogel

jtkrogel commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Review comments addressed

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.

4 participants