Repository navigation
Conversation
…guide An EON campaign takes an optional top-level `detector` block with the settings of `reaction_run.detector` in an MD campaign. Every place EON mode classifies bonds now uses it: the labels of processes and of rejected searches, the join of a rejected search by its bonds, and the bonds a guide goes by. Basins, the thermal window and `status` read those labels. Until now all of these used the default distances and the campaign file had no place for others, so metal contacts counted as bonds. `validate` refuses a malformed block as it does in an MD campaign. The settings are part of the resume contract when they differ from the defaults. A campaign without the block gives the same labels, basins and records, and the same contract apart from the hashes of `eon.py`, `runner.py` and `labels.py`. Those hashes stop an EON campaign already in progress from resuming on this code.
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
EON mode always used the default bond distances, 1.15 and 1.30 times the sum of the covalent radii, and an EON campaign had no place for others: a
detectorkey was refused as unknown. On a metal surface those distances make metal-metal and metal-adsorbate contacts bonds. An adsorbate that moves to the next site is then labelled as a reaction, leaves its chemical basin, and is offered to a guide as a bond to break.An EON campaign now takes an optional
detectorblock at its top level, besideakmcandeon, with the settings ofreaction_run.detectorin an MD campaign:A campaign without the block gives the labels, basins and records it gave before. Adds a net 37 lines in
src(+59/−22); about 20 of the added lines are signatures and calls that ruff rewraps once they gain an argument.detectorin an EON campaign:unknown EON campaign keys: ['detector']validate, and usedformed C-Pt, a chemical stepno bond change, the same basinbroken Cu-H x2and the one chemical step the run takesCu-Hleft out: a change of conformer, and the step that counts breaks H-H, as without the Cu atomvalidatebefore any model loads, as in an MD campaignEON mode classifies bonds in two functions, and both now take the campaign's settings:
labels.bond_changeseon.guided_pushReverse labels, basins, the thermal window and
statusread the saved labels and classify nothing.records.pyandakmc.pyhold no bond code, andstatus.pyis MD only.What to look at when merging
eon.py,runner.pyandlabels.pyare hashed into a campaign's contract.runexits 1 withexploration structure, settings, model, or code changedand writes nothing butlast-error.json;statusstill reads the campaign. Finish one first, or keep it on its old install.mainwrites only in those three hashes. Thedetectorentry goes into the contract only when the settings differ from the defaults. The alternative is to always write it, asakmcandeonwrite their defaults: that would also bind the default distances, and it would change every contract.statusshows the labels saved with each record.reaction_run.detector: an EON campaign has noreaction_run, and everything else in that block is MD only. Not undereon: those are EON's own search settings, and the bond distances also decide the runner's labels and basins.reaction_runin an EON campaign is still an unknown key.persistence_framesis accepted and does nothing in EON mode, so that an MD block can be copied as it is. The settings table says so. Refusing it instead would take a few lines.bond_changesandguided_pushtake the detector settings as a required argument, so a call cannot fall back to the defaults by leaving it out.EONBackendandrun_explorationtake them as an optional one, sodocs/figures/make_data.pyruns as it is.Left out on purpose
reactionflow init, which leaves detection at its defaults for MD as well.validateorstatus, which would change that output for every campaign.detection.py, whereclassify_bondslives, in the hashed search code. It is not bound today.pair_thresholdsthat is not an object raises a rawAttributeErrorin both modes. An infinitebreak_scalepassesvalidatein an MD campaign; an EON campaign refuses any non-finite number. The MD side is as onmain.Testing
The ways this could fail were written down first, then the tests, then the code:
runreads the block and does not hand it on, to the runner or to the backend.validate, or the two modes disagree on one.tests/: a guide on CO bridging two Cu atoms; H2 over a Cu atom through the runner, for labels, basins, the join and the rejected minima, where leaving the contacts out gives every record of the molecule alone; the contract;runthrough the CLI, checking both what the backend is given and the saved labels; andvalidateon seven malformed blocks in both modes.src. Ten fail a test of the regular suite. The eleventh, the backend not handing its settings to the guide, fails only the new real-EON case.main(34d9ed4) for campaigns without the block, using the stand-in backends of the test suite: 30 explorations throughreactionflow runandrun_exploration, with and without basins, with joined and rejected searches, for molecules alone and over Cu and Pt atoms, and 2,100 guided pushes. Of 483 files, the 373 records, the 30search-state.jsonand the output of every command are byte-identical. The only lines that differ are therunner.pyandlabels.pyhashes in the 30 contracts.EONBackend.contractdiffers only in theeon.pyhash.validateandstatusonexamples/eon/campaign.jsonare identical.runthrough the CLI, 14 of 14 bond classifications were given the defaults without the block, and 18 of 18 the block's settings with it.statusandvalidatemade none.mainin its fourth search was refused on this branch, then resumed onmainto the records of an uninterrupted run.formed C-Pt. With the block above, C-O is the only bond, the same move isno bond change, and a guide has no Pt-Pt or C-Pt contact to break.ruff check .,ruff format --check .andpytestpass: 361 passed, 26 skipped, against 356 and 25 onmain. Python 3.12.3, macOS arm64.Not run:
tests/test_eon_integration.py, with its one new case, andtests/test_eon_example.pywere skipped here and run ineon.yml. The new case, and the two beside it, were run here against a stand-in for pyeonclient that can only build parameters; all three end asno_pushbefore EON is asked for anything else. Every comparison above used stand-in backends.python -m build, a real model, a GPU and a cluster.