Repository navigation
Conversation
publish_outcome writes pathways/<occurrence>/ with result.json, images.traj and a step-N folder for each step, under a temporary name until complete, as ReactionRun._publish_outcome did. The method now looks up the occurrence's class and calls it. No file a run writes changes. This is for reactionflow band, which refines a step that no run found and writes the same result files.
reactionflow band CAMPAIGN REACTANT PRODUCT --out FOLDER takes a step that is already known and refines it without MD. It relaxes the two ends at the trajectory's pressure or at --pressure, or at fixed cell when there is none, and runs the band, the climb and the saddle check through refine_pathway with the campaign's model, bond thresholds, region radius and pathway settings. The model and the pressure are named as for reactionflow check. The tracker makes the candidate from the two files, as from two observations, with each file's bonds read as in the first frame of a trajectory. Files with the same bonds, with changes in several separate regions, with different atoms, or with atom IDs in one of them only are refused before the model is loaded. A file with several frames or with constraints is used as run uses a starting structure, and says so in the same way. The folder gets candidates/band, pathways/band and reactions.sqlite3 in the form of a trajectory's folder, written by the store and the publishing function a run uses, so reactionflow check and reactionflow export-electrace read it unchanged. A folder that already holds a band, or a trajectory's own folder, is refused, and an interrupted band starts over in its folder. Refinement itself is unchanged: no tolerance, threshold, time limit or acceptance rule is added, and max_hours_per_barrier is not applied.
The pathway guide gains a section on refining a known step: what the two files must hold, how the step becomes a candidate, that the product starts from the relaxed reactant as in every refinement, what the folder holds, and what a rerun does. It states what band does not do: it takes no images from another band, continues no unfinished band, applies no time limit, and is not listed by reactionflow status. The README and the overview name the command.
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.
Summary
reactionflow bandrefines one step without MD. Until now a band could only come from an eventthat
runfound, at that trajectory's pressure, so taking a step to other pressures needed scriptsoutside the package. The command takes a reactant file and a product file, relaxes the two ends at
the stated pressure (or at fixed cell when there is none), checks their bonds, runs NEB or SSNEB
and the climbing image, and applies the saddle gate. It does this by calling
refine_pathway(),the function
runcalls, with the campaign's model, bond thresholds, region radius, and pathwaysettings.
Refinement itself is unchanged. No tolerance, threshold, step limit, time limit, default, or
acceptance rule is added, and no result file or campaign key changes. A run writes the same files
as before.
Adds a net 143 lines in
src(+179/−36). Ruff and the tests pass at each commit.srclinespublish_outcomeis split out ofReactionRun._publish_outcome, so a run andbandwrite results with the same coderefine_bandand thebandcommand incli.py, besidecheck_band, with 14 tests intests/test_band.py. Two predicates are lifted out of_start_warningsso that both use themdocs/pathway-refinement.md, and the command named in the README and the overviewWhat the command does, in order:
check:--indexpicks the trajectory whose model andpressure are used, and
--pressurereplaces that pressure. Zero is a pressure. With anulltrajectory pressure and no
--pressure, the cell is fixed. As withcheck, no option asks for afixed cell when the trajectory has a pressure, and
require_gpuis not enforced.neither does. ASE's
file@Npicks a frame, soimages.traj@0andimages.traj@-1are therelaxed ends of an earlier band. A file with several frames, or with constraints, is used as
runuses a starting structure, with the same kind of warning.
ReactionTracker, as from two observations of a trajectory, withcandidate_region_radiusfrom the campaign. Each file's bonds are the pairs within theirformation distance, the rule the detector applies to the first frame of a trajectory.
changes in two or more separate regions, different atoms, atom IDs in one file only.
refine_pathway(candidate, ...)withreaction_run.pathwayandreaction_run.detector. Ends whose bonds change on relaxation end ascollapsedorunresolvedwith the reason, and every other status is the existing one.
--outgetscandidates/band/,pathways/band/andreactions.sqlite3in the form of a trajectory's folder, written by
OccurrenceStoreandpublish_outcome.checkand
export-electracereadpathways/bandunchanged.trajectory's folder. An interrupted band has published nothing and starts over in its folder.
What to look at when merging
Most of these follow from reusing
run's path as it is. Each is a place where another choice ispossible.
starts from the relaxed reactant, cell included, with only the atoms in changed bonds and the
atoms bonded to them placed at their fractional coordinates in the product file. The rest of the
product file is not used. On the xTB example this moved the product end by 0.02 to 0.10 Å against
the run's own product and changed barriers by at most 1.4 meV.
The two hot frames stored with an occurrence can have the changing bond between its thresholds,
and are then read differently from the tracker's record: of the seven xTB occurrences, six ended
unresolvedthis way and one gave the run's barrier to the last digit.runrefines those as two events. Themessage names the pairs.
max_hours_per_barrieris not applied: its clock lives in atrajectory's
state.json. An unfinished band is not continued either, so a band needs a job longenough to finish it.
reactionflow statusdoes not list a band. It readsoutput_root/<trajectory-id>foldersthat have a
state.json, and takes each class's pressure from the trajectory. The band's folderhas the same registry and result files, but nothing reads them into a table yet.
result.jsonhas the keys a run writes and no more, so it does not say which model orcampaign made the band. A run's result does not either, but there the trajectory's folder does.
checkon a band needs the band's--pressure, becausechecktakes the trajectory's.failedone after a model error.test_run.pyandtest_ssneb.py, which no test module didbefore. The alternative was to copy the scripted runtime and two calculators.
docs/cli.md, which says there are nine commands. Whichever merges second needs thebandentry at the end of this description.Differences from the campaign scripts
The package's rules are kept in every row. "Setting" says whether an existing campaign setting
expresses the scripts' choice. No setting was added.
reactionflow bandimages, 7 by defaultreaction_run.pathway.imagesfmax: the largest force on any atom or cell row of any image ≤neb_fmax, 0.05 eV/Åneb_fmax; the norm is not a settingneb_steps2000, thenci_neb_steps2000relax_steps2000relax_stepsrelax_fmax0.05 eV/Å on the combined atomic and cell gradient, with no stress tolerance. For the 192-atom example cell this is about 0.17 GPa on one stress component (0.05·J/V with J = N^(1/6)·V^(1/3); an estimate from the filter's scaling, not measured)relax_fmax; no stress settingreaction_run.detector.pair_thresholds, which needs two distances per pair--pressure, or the trajectory'sLeft out on purpose
from the two relaxed ends, the way
rundoes. The transport and redistribution that the campaignneeded are a separate piece of work.
over.
banddoes the same.hot frames (see above). Doing it properly means refining the stored candidate with the run's saved
frames, which needs
ReactionRun._saved_framesmoved out of the class and a second way to callthe command. That is not small.
_refine_stepbuilds every band, and needs a rule for where the image sits and how the othersare spread.
status, a model record inresult.json, a whole-cell graph checkagainst the input files, and settings for the spring constant, a stress tolerance, or L-BFGS.
Each is a default, an acceptance rule, or a file format.
Testing
code, then the 14 tests, which all failed on the missing command, then the code. Two cases were
added later, each as a failing test first: a file name that picks several frames, and the folder
of a trajectory that has not started. The pressure test was then widened to take its ends from
another pressure, and passed as it stood. One assertion was wrong and was narrowed: it compared
the volumes of images that the springs leave loose, where the SSNEB test compares only the first,
highest, and last.
run, fixed cell. From the two ends of a refinement thatrunmade on the pairdouble well,
bandgivessaddle_validatedand the barrier to 1e-6 eV. By hand, on six morecases of the pathway tests against
refine_pathwaycalled as those tests call it (atom IDs inanother order with a cell 1% larger, a spectator on a ridge at fixed cell and at zero pressure,
a reactant taken from an earlier frame), status and barrier agree to 4e-7 eV.
run, at a pressure. On the SSNEB test system, ends from arefinement at 0 GPa give at 0.8 GPa the enthalpy barrier that a refinement inside
rungivesthere, and the reverse, both to 1e-4 eV (0.0952 and 0.0625 eV). By hand, for 15 pairs of
pressures from 0 to 2.4 GPa the highest point of the profile agrees to 3e-6 eV. Both end
no_saddle, as the existing SSNEB test explains.collapsedand
unresolvedwith the reason and the two relaxed ends. Structures that are not one step arerefused before the model loads, with a model that cannot be imported.
checkgives the band's own status and enthalpies, andexport-electracewritesits frames, pressure, and focus atoms. A step that splits exports from its
step-2folder.bandfrom the two ends of eachrefinement gave
saddle_validated7 of 7, barriers within 0.04 to 1.4 meV of the run's 0.122 to0.186 eV, and the same imaginary mode within 6 cm⁻¹. The reactant end did not move.
ruff check,ruff format --check, andpython -m build, on Python 3.12.3, ASE 3.29.0, NumPy 2.5.5, macOS.band of a real crystal under pressure, Python 3.14, and Linux. The only pressure tests use the
analytic volume-coupled double well. The xTB example is a cluster at fixed cell.
One thing seen and not touched: on the SSNEB test system at 1.6 GPa, with the product's H–H pair
also shifted as a whole, the band of
run's own refinement steps over the saddle and endsno_saddlewith "an endpoint is the highest point".bandgives the same.Entry for
docs/cli.mdonce #89 is inThe command table gets one row, and "nine commands" becomes ten.