Skip to content

[WIP] Migrate abinit and gromacs parsers to WorkflowConvergenceTarget API#162

Closed
ndaelman-hu wants to merge 1 commit intodevelopfrom
feature/convergence-targets-migration
Closed

[WIP] Migrate abinit and gromacs parsers to WorkflowConvergenceTarget API#162
ndaelman-hu wants to merge 1 commit intodevelopfrom
feature/convergence-targets-migration

Conversation

@ndaelman-hu
Copy link
Copy Markdown
Collaborator

Purpose

Migrate abinit and gromacs parsers from removed convergence_tolerance_* fields to the new WorkflowConvergenceTarget subsection API.

Scope

Included

  • Parser functions to extract convergence criteria and return dicts with m_def specifications
  • Schema mapping annotations for convergence_targets subsection
  • Proper unit conversions (hartree, hartree/bohr, kJ/mol/nm)

Out of scope

  • Full functional verification (draft PR for investigation)

Context & Links

Addresses #161

This PR implements the migration as described in the issue. The code structure follows the expected patterns, but needs investigation to verify the convergence_targets are properly populated in generated archives.

Investigation Needed

Check for complex interactions between:

  • Legacy schema in nomad-FAIR (nomad.datamodel.metainfo.simulation.workflow)
  • New schema in nomad-simulations (nomad_simulations.schema_packages.workflow)
  • Normalizers that may sync data between schema versions

Testing

Abinit and gromacs parser tests pass (49 tests total).

Status

  • Draft - needs investigation and functional verification

Reviewer Notes

This is a draft PR to preserve the migration work in progress. Assign to yourself to continue this work.

Add parser functions and schema mappings to extract convergence criteria
using the new WorkflowConvergenceTarget subsection approach.

Changes:
- abinit: Extract tolmxde → EnergyConvergenceTarget, tolmxf → ForceConvergenceTarget
- gromacs: Extract emtol → ForceConvergenceTarget
- Add get_convergence_targets() methods to both parsers
- Add mapping annotations with proper units and m_def specifications
- Fix gromacs GeometryOptimizationModel parent class

All 49 tests pass, but convergence_targets not appearing in generated
archives. Complex schema interactions between legacy and new schemas need
investigation before this can be finalized.

Related to #161
@ndaelman-hu ndaelman-hu self-assigned this Mar 23, 2026
@ndaelman-hu ndaelman-hu added enhancement New feature or request electronic parser labels Mar 23, 2026
ndaelman-hu added a commit that referenced this pull request Mar 25, 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>
@ndaelman-hu
Copy link
Copy Markdown
Collaborator Author

Closing this WIP PR as the convergence parsing has been addressed by PR #150 (now merged).

This PR served its purpose as an exploratory implementation demonstrating the dict-based m_def mapping annotation approach. The architectural question it raised about parser adherence to schema-focused annotations is now tracked in issue #165.

PR #150 implemented convergence parsing for abinit, gromacs, and 6 other parsers using direct class instantiation. Issue #165 captures the broader task of evaluating and migrating parsers to the declarative mapping annotation pattern demonstrated in this PR.

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

electronic parser enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant