Scf convergence migration#151
Merged
ndaelman-hu merged 13 commits intoschema_update_convergence_targetsfrom Mar 23, 2026
Merged
Scf convergence migration#151ndaelman-hu merged 13 commits intoschema_update_convergence_targetsfrom
ndaelman-hu merged 13 commits intoschema_update_convergence_targetsfrom
Conversation
… relevant to convergence
Collaborator
Author
|
Here are the implementation notes: |
- Update Abinit test to handle dimensionless threshold for relative convergence - Update Exciting test helper to handle both plain floats and Pint Quantities - Both parsers now work correctly with flexible_unit=True
Remove `.magnitude` extraction in `get_optimization_convergence()` to pass
complete Pint Quantity instead of bare float.
**Problem:**
GUI crashed with error: "Please provide the value for a Quantity as a number,
or as a multidimensional array of numbers" when displaying convergence targets.
**Root cause:**
- Parser extracted only the numeric value: `threshold.to('newton').magnitude`
- This created a bare float without units
- When serialized (before `normalize()` runs), bare floats lack `m_unit` field
- GUI expects ALL quantities to have `m_unit` field, even dimensionless
**Fix:**
Keep threshold as Pint Quantity: `threshold.to('newton')`
**Serialization comparison:**
Before (bare float):
```json
{
"threshold": {
"m_value": 4.11e-09
// Missing m_unit!
}
}
```
After (Pint Quantity):
```json
{
"threshold": {
"m_value": 4.11e-09,
"m_unit": "newton",
"m_original_unit": "newton"
}
}
```
All tests pass. GUI can now display convergence targets correctly.
Change charge convergence unit from `elementary_charge` to `coulomb` to fix GUI unit parser error. The GUI uses mathjs units which doesn't recognize `elementary_charge` as a valid unit name. **Error fixed:** ``` SyntaxError: Unit "elementary_charge" not found. at parseInternal (src/components/units/common.js:313) ``` **Changes:** - exciting parser: Use `ureg.coulomb` instead of `ureg.elementary_charge` for charge convergence threshold - Test expectations: Update values from elementary_charge-based to coulomb-based **Conversion factor:** `1 elementary_charge = 1.602176634e-19 coulomb` All tests pass.
6b1ea62
into
schema_update_convergence_targets
3 checks passed
ndaelman-hu
added a commit
that referenced
this pull request
Mar 23, 2026
Temporarily disable mappings to `convergence_tolerance_energy_difference` and `convergence_tolerance_force_maximum` in abinit and gromacs schema packages. These fields were removed from `GeometryOptimizationMethod` in nomad-simulations#260 (merged March 19) and replaced with `WorkflowConvergenceTarget` subsections. PR #151 was written against the old API but merged after the schema change, causing parser loading failures. This commit restores functionality. Follow-up commit will migrate to the new `WorkflowConvergenceTarget` API.
This was referenced Mar 23, 2026
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.
Implemented SCF convergence migration across all target parsers (
abinit,ams,crystal,exciting,fhiaims,gpaw,quantumespresso,vasp) to the new workflow +scf_stepsmodel.High-level changes:
outputs.scf_steps(energy deltas, energies, durations, and code-specific SCF metadata where available).workflow2(SinglePoint,GeometryOptimization, and MD where relevant), including SCF and geometry thresholds.scf_stepsfields and avoid duplicated/legacy convergence storage.SCF_CONVERGENCE_MIGRATION.md) with per-parser status, approach, caveats, and test outcomes.Net result:
depends on FAIRmat-NFDI/nomad-simulations#260