RMG-Py
RMG-Py copied to clipboard
Training reactions constraints
This PR added a constraints
param to the add_rules_from_training
method so that the user can use certain criteria to pick and choose which training reactions to include (and exclude) when creating rate rules for non-auto gen families when the rules are compiled at the start of an RMG job. The constraints are:
-
metal
: list of allowed metals (e.g ['Pt']) -
facet
: list of allowed facets (e.g ['111']) -
elements
: list of allowed elements (e.g ['C','H','O']) -
forward_only
: True/False, if True, only reactions in the forward direction are allowed
Using these constraints will allow us to customize the kinetics trees for individual RMG jobs. For example, we know that the facet can have a profound affect on activation barriers (https://www.nature.com/articles/s41467-019-12858-3 shows example with CO2), and using a facet
constraint will enable use to constrain which facets we want to include when creating rate rules.
Although we don't have many surface training reactions in the database right now, adding constraints will be more useful as we continue to add more training data (as we are doing in the PR https://github.com/ReactionMechanismGenerator/RMG-database/pull/479)
Testing
I have not added any unit tests yet, but I built a few surface ammonium oxidation models with and without training reactions constraints.
Note - this PR does not fix the "issue" that if a surface training reaction is isomorphic to a reaction in the model, the kinetics for that training reaction will be assigned to that reaction, regardless of metal or facet. A further discussion is needed to determine what approach to take here:
- strict - assume isomorphic iff metal and facet match
- medium - use BEP to scale the Ea based on the thermo of reaction (could enforce that facets match here or not, not sure)
- loose - ignore metal and facet and allow all isomorphic matches
Codecov Report
Merging #2145 (3a8dc47) into master (38c49f7) will increase coverage by
0.00%
. The diff coverage is15.90%
.
@@ Coverage Diff @@
## master #2145 +/- ##
=======================================
Coverage 47.43% 47.43%
=======================================
Files 89 89
Lines 23995 24036 +41
Branches 6258 6278 +20
=======================================
+ Hits 11381 11402 +21
- Misses 11411 11433 +22
+ Partials 1203 1201 -2
Impacted Files | Coverage Δ | |
---|---|---|
rmgpy/rmg/input.py | 40.24% <5.26%> (-1.03%) |
:arrow_down: |
rmgpy/data/kinetics/family.py | 48.68% <21.73%> (-0.25%) |
:arrow_down: |
rmgpy/rmg/main.py | 22.56% <50.00%> (+0.05%) |
:arrow_up: |
arkane/kinetics.py | 12.24% <0.00%> (ø) |
|
rmgpy/molecule/draw.py | 54.03% <0.00%> (+1.28%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 38c49f7...3a8dc47. Read the comment docs.
We could make it remove the training reactions that don't satisfy the constraints, so that they don't get turned into rules and they don't get used later if fully isomorphic.
And/or we could say anything that's not fully isomorphic (with metal and facet) then don't use the training reaction (from the wrong metal or facet) and instead use the tree-based estimate (which would at least be a specific node)
What to do with Matt's auto-generated trees when we have different metals and facets is an unsolved problem to be discussed another day...
This pull request is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant pull request, otherwise it will automatically be closed in 30 days.