Skip to content

Schema update convergence targets#150

Merged
ndaelman-hu merged 24 commits intodevelopfrom
schema_update_convergence_targets
Mar 25, 2026
Merged

Schema update convergence targets#150
ndaelman-hu merged 24 commits intodevelopfrom
schema_update_convergence_targets

Conversation

@JFRudzinski
Copy link
Copy Markdown
Collaborator

@JFRudzinski JFRudzinski commented Feb 17, 2026

@JFRudzinski JFRudzinski force-pushed the schema_update_convergence_targets branch from 4d90338 to b893564 Compare February 17, 2026 12:52
JFRudzinski and others added 6 commits February 17, 2026 15:51
  Migrate SCF convergence data to unified `scf_steps` and workflow model

  Standardizes SCF convergence handling across 8 parsers (abinit, ams, crystal,
  exciting, fhiaims, gpaw, quantumespresso, vasp).

  - Extract SCF iteration data into `outputs.scf_steps` sections
  - Populate `workflow2` convergence targets for all workflow types
  - Update schema mappings and add comprehensive tests

  Depends on FAIRmat-NFDI/nomad-simulations#260
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 23, 2026

Pull Request Test Coverage Report for Build 23545569179

Details

  • 987 of 1124 (87.81%) changed or added relevant lines in 30 files are covered.
  • 103 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+2.0%) to 72.952%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/nomad_simulation_parsers/parsers/gpaw/parser.py 20 21 95.24%
src/nomad_simulation_parsers/parsers/lammps/parser.py 0 1 0.0%
src/nomad_simulation_parsers/parsers/abinit/parser.py 68 72 94.44%
src/nomad_simulation_parsers/parsers/fhiaims/parser.py 44 49 89.8%
tests/parsers/test_abinit_parser.py 53 59 89.83%
src/nomad_simulation_parsers/parsers/exciting/parser.py 107 114 93.86%
src/nomad_simulation_parsers/parsers/vasp/xml_parser.py 75 93 80.65%
src/nomad_simulation_parsers/parsers/ams/parser.py 40 59 67.8%
src/nomad_simulation_parsers/parsers/crystal/parser.py 47 69 68.12%
src/nomad_simulation_parsers/parsers/vasp/outcar_parser.py 43 66 65.15%
Files with Coverage Reduction New Missed Lines %
src/nomad_simulation_parsers/parsers/wannier90/parser.py 1 80.0%
src/nomad_simulation_parsers/parsers/crystal/parser.py 4 73.0%
src/nomad_simulation_parsers/parsers/ams/parser.py 7 72.66%
src/nomad_simulation_parsers/parsers/vasp/outcar_parser.py 8 75.22%
src/nomad_simulation_parsers/parsers/fhiaims/parser.py 12 47.34%
src/nomad_simulation_parsers/parsers/octopus/parser.py 13 65.05%
src/nomad_simulation_parsers/parsers/quantumespresso/parser.py 58 53.67%
Totals Coverage Status
Change from base Build 23537167700: 2.0%
Covered Lines: 7258
Relevant Lines: 9949

💛 - Coveralls

@JFRudzinski JFRudzinski marked this pull request as ready for review March 25, 2026 11:20
Resolve conflicts from recent develop changes:
- Remove TODO comments for convergence tolerance fields (removed in nomad-simulations#260)
- Keep linting fix for quantum espresso XC functional parsing
- Keep improved error handling for GROMACS TPR file reading
- Preserve rsplit for LAMMPS file extension parsing
@ndaelman-hu
Copy link
Copy Markdown
Collaborator

Merge Status Update

Successfully merged develop into pr-150 and resolved all conflicts:

Conflicts Resolved

  • abinit.py: Removed TODO comments for convergence tolerance fields (removed in nomad-simulations#260)
  • gromacs.py: Removed TODO comments for convergence tolerance fields
  • quantumespresso/parser.py: Kept linting fix for XC functional parsing (PLC0207)
  • lammps/parser.py: Preserved rsplit for file extension parsing
  • gromacs/mdanalysis_parser.py: Kept improved error handling for TPR file reading

Unit Tests: ✅ All Passing

Ran unit tests for all 8 parsers with convergence parsing additions:

  • abinit: 5/5 tests passed
  • exciting: 6/6 tests passed
  • fhiaims: 3/3 tests passed
  • crystal: 2/2 tests passed
  • gpaw: 2/2 tests passed
  • quantumespresso: 15/15 tests passed
  • vasp: 4/4 tests passed
  • ams: 2/2 tests passed

Total: 39/39 tests passed

Next Steps

Moving on to testing with real-world samples from:

  • ~/Downloads/nomad-samples
  • .volumes deployment

@ndaelman-hu
Copy link
Copy Markdown
Collaborator

Real-World Sample Testing Complete

Tested PR #150 with production NOMAD samples stored in .tests/pr-150-convergence/.

Sample Verification Results

Abinit (case_2: Cu geometry optimization)

"convergence_targets": [
  {
    "m_def": "...EnergyConvergenceTarget",
    "threshold": {"m_value": 0.0},
    "threshold_type": "relative"
  },
  {
    "m_def": "...ForceConvergenceTarget", 
    "threshold": {"m_value": 0.0, "m_unit": "hartree / bohr"},
    "threshold_type": "maximum"
  }
]

FHI-aims (case_1: geometry optimization with 17 ionic relaxation steps)

"convergence_targets": [
  {
    "m_def": "...ForceConvergenceTarget",
    "threshold": {"m_value": 0.001, "m_unit": "electron_volt / angstrom"},
    "threshold_type": "maximum"
  }
]

Each relaxation step contains 7-10 SCF cycles with delta_energies_total and delta_density_rms extracted.

Summary

Parser Samples Tested Convergence Parsed SCF Steps Parsed
abinit 2 Yes Yes
ams 1 Yes Yes
crystal 2 Yes Yes
exciting 2 Yes Yes
fhiaims 2 Yes Yes
gpaw 2 Yes Yes
gromacs 2 Yes N/A

All real-world samples parse successfully with convergence data and SCF steps extracted correctly.

See .tests/pr-150-convergence/README.md for detailed testing documentation.

@ndaelman-hu
Copy link
Copy Markdown
Collaborator

@JFRudzinski above you can find local tests that were run using the CLI parser. If you agree, I merge this now.
Else, I see to expand the test coverage scope + try the GUI, but that will delay this PR till tomorrow morning.

@ndaelman-hu ndaelman-hu self-requested a review March 25, 2026 14:15
@ndaelman-hu ndaelman-hu self-assigned this Mar 25, 2026
@JFRudzinski
Copy link
Copy Markdown
Collaborator Author

no, please go ahead and merge now 👍 ... I guess you have to give the approval yourself since it is my PR originally

Copy link
Copy Markdown
Collaborator

@ndaelman-hu ndaelman-hu left a comment

Choose a reason for hiding this comment

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

Not fully in line with mapping annotations' focus on annotating the schema directly (instantiating instead via the operators), but this can be fixed later down the road.

@ndaelman-hu ndaelman-hu merged commit 0e00561 into develop Mar 25, 2026
9 checks passed
Bernadette-Mohr pushed a commit that referenced this pull request Mar 26, 2026
Add convergence target and SCF steps parsing to 8 parsers

Adds support for parsing workflow convergence criteria (`EnergyConvergenceTarget`, `ForceConvergenceTarget`) and SCF iteration data (`SCFSteps`) following schema updates in nomad-simulations#260.

**Parsers updated:** abinit, ams, crystal, exciting, fhiaims, gpaw, quantumespresso, vasp

**Implementation:** Uses direct class instantiation approach. Future migration to dict-based `m_def` mapping annotations should be tracked separately (see PR #162 for reference).

**Testing:** 39 unit tests added, all passing. Validated with production samples in `.tests/pr-150-convergence/`.

Depends on nomad-simulations#260

Co-authored-by: Joseph Rudzinski <joseph.rudzinski@physik.hu-berlin.de>
Co-authored-by: Nathan Daelman <nathan.daelman@physik.hu-berlin.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants