Forbidden structs in input#2185
Conversation
|
|
If we like this, I can update documentation. |
Codecov Report
@@ Coverage Diff @@
## main #2185 +/- ##
==========================================
- Coverage 47.25% 47.21% -0.05%
==========================================
Files 104 104
Lines 27679 27695 +16
Branches 7120 7123 +3
==========================================
- Hits 13080 13076 -4
- Misses 13195 13211 +16
- Partials 1404 1408 +4
Continue to review full report at Codecov.
|
|
I've wanted this feature for a long time. From a quick look your implementation looks reasonable to me, but I would welcome other comments. One question I had was whether we need the separate Please add to a few example input files, including RMG-Py/examples/rmg/commented/input.py, as well as the documentation. Edited to add: |
Yes, the SMILES does work with forbidden in the input. I thought a little more about the need for |
ChrisBNEU
left a comment
There was a problem hiding this comment.
This is great, thanks for adding it. I agree documentation and examples should be updated. All I had was the questions below, I wasn't sure why we specifically check for the "+".
Thanks Chris. We try to avoid the "+" in the species label because "+" is the delimiter we use in a reaction label to separate reactions and products (A + B = C + D). If there is a "+" in the species label, then it will mistakenly be split if we use "+" to split the reaction label to separate the reactants and product. The forbidden species labels are not used in the reactions, so we probably could allow "+", but it's safer to just avoid using it as a general rule. |
44eea46 to
f029b80
Compare
rwest
left a comment
There was a problem hiding this comment.
Thanks for adding the documentation! Made a few suggestions. Please also add to a couple of the examples at RMG-Py/examples/rmg/ (including the commented one which I think is supposed to be pretty complete)
| Forbidden Structures | ||
| ===================== | ||
|
|
||
| RMG exlores a wide varitey of structures as a builds a mechanism. |
There was a problem hiding this comment.
| RMG exlores a wide varitey of structures as a builds a mechanism. | |
| RMG exlores a wide varitey of structures as it builds a mechanism. |
| RMG exlores a wide varitey of structures as a builds a mechanism. | ||
| Sometimes, RMG makes nonsensical, unphysical, or unstable species that make their way into the core. | ||
|
|
||
| Luckily, RMG has a remedy to prevent these undesirable structures from making their way into your mechanism. |
There was a problem hiding this comment.
This all sounds a bit "chatty" to me. But if that's the style of the rest of the manual, it's fine. Not a big problem anyway - at least we have documentation now!
| RMG's ForbiddenStructures database contains structures that are forbidden from entering the core. | ||
|
|
||
| While this database forbids many undesirable structures, it may not contain a species | ||
| or structure you would like to exclude from your model. If you would like to add a forbidden structure for your RMG job, |
There was a problem hiding this comment.
To "add a forbidden structure to your job" could be misinterpreted. We want to forbid a structure from our model, not add it.
|
|
||
| If you would like to forbid a functional group from your mechanism, use the ``adjacencyListGroup`` syntax in the forbidden block. | ||
|
|
||
| The following is an example of a forbidden structure using ``adjacencyListGroup``:: |
There was a problem hiding this comment.
I first thought this was an adsorbed CO molecule, and took a long time (of writing and deleting comments) before realizing it was R2C*-O*. Not sure how to fix. Maybe change its label? and/or describe it when saying "..an example of a forbidden structure.." ?
There was a problem hiding this comment.
....and now I see you have that description just below on line 288. OK, so just move that up to before the example.
f029b80 to
7e5e56e
Compare
|
I added I also set |
|
Not sure why the documentation build failed https://github.com/ReactionMechanismGenerator/RMG-Py/pull/2185/checks?check_run_id=3194731015 |
7e5e56e to
c37d264
Compare
abdc785 to
0196ae6
Compare
forbidden structures (mol or group) are read from the input file and added to forbidden structures database for rmg job
If input species are allowed, we need to set spec.explicitly_allowed to True, otherwise if the spec is forbidden by the forbidden strucutres database, it will not be allowed
we will not ban an input species if `input species` are allowed (even if the species is forbidden in the forbidden structures database)
0196ae6 to
1a896f1
Compare

Motivation or Problem
I wanted to add a forbidden structure to my input file, and realized that we didn't have this feature, so I am adding it here.
Description of Changes
forbiddento input.py with label and structure (mol or group)Testing
built a few models with it, and it works as expected