✨ PwOutput: gate total_energy on the calculation type#150
Merged
Conversation
For `nscf` and `bands` runs QE never assigns `etot` and writes `<etot>0.0</etot>` to the XML. When such a run shares its `prefix` with a prior `scf` run — the standard `scf → nscf → bands` workflow — the nscf run also overwrites the scf XML at `<prefix>.save/`, so the meaningful total energy is gone from disk regardless of what the user asked for. `total_energy` is now resolved with a `Coalesce` of two branches: an XML branch gated by `Check` on `xml.input.control_variables.calculation`, and a stdout fallback. The XML branch is taken only for documented calculations types (scf, relax, vc-relax, md, vc-md). For nscf/bands runs the gate fails and `Coalesce` falls through to the stdout branch. `PwStdoutParser` now extracts the converged energy from the last `! total energy = ... Ry` line (relax/md print one per ionic step; the final value is the converged one). Side effect: the `collinear` fixture (which is itself an nscf XML) previously surfaced `total_energy: 0.0`. With the gate in place the field is correctly absent — the `0.0` was always meaningless. The regression snapshot drops it.
pw.x parsing feature setPwOutput: gate total_energy on the calculation type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.