You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now to run RMG, users write a functional Python script which is then actually executed (using exec) by RMG to load the requested reactors, species etc. into memory. The problems with this are:
this is formatting sensitive and tedious
exec is a security risk
exec is difficult to debug
exec requires passing the global and local namespace to the executed file, which is slow
Desired Solution
I mentioned in #2633 that the Green group has been planning to switch the input file format to YAML, and with the opening of #2633 it seems like a good time to announce this formally.
In line with cantera, RMS, and so many other modern tools, users will specify their simulation setup in a yaml format like:
- reactor:
- type: simple
- temperature: 200 K
- species:
- smiles: C
- smiles: CC
- constraints:
- max_size: 4
which will then be loaded by RMG.
Potential Alternatives
The easy thing to do would be to just not do this, but for the outlined reasons this is a bad idea.
Should we provide a script to convert old .py files to the new .yaml format? I suspect this would be more difficult than it seems, and it is not a significant burden to ask people to rewrite their input files in the new simpler format (IMO, welcome thoughts here).
The text was updated successfully, but these errors were encountered:
This is a great initiative and I'm on board with this. A couple of initial thoughts:
ARC already uses the .yml input format and overlaps strongly / utilizes RMG & Arkane in its codebase. It might be worth chatting with people who've worked on ARC (@alongd) because some of the work might already be "done" in ARC.
No strong feelings yet on if we should supply a conversion script. My initial thought is to allow both .py and .yml for now, with a DepreciationWarning if .py is used, and slowly transition to .yml in a future release. I agree a conversion script might be a lot of work, and input files tend not to be super complex, so I would also lean towards not providing it, as long as we provide some examples of "before" and "after" input files.
Motivation or Problem
Right now to run RMG, users write a functional Python script which is then actually executed (using
exec
) by RMG to load the requested reactors, species etc. into memory. The problems with this are:exec
is a security riskexec
is difficult to debugexec
requires passing the global and local namespace to the executed file, which is slowDesired Solution
I mentioned in #2633 that the Green group has been planning to switch the input file format to YAML, and with the opening of #2633 it seems like a good time to announce this formally.
In line with
cantera
,RMS
, and so many other modern tools, users will specify their simulation setup in ayaml
format like:which will then be loaded by RMG.
Potential Alternatives
The easy thing to do would be to just not do this, but for the outlined reasons this is a bad idea.
etc.
environment.yml
Unblocking Python 3.11 - rdkit to conda-forge channel, remove chemprop for now #2553 we can now begin to move to Python 3.11+ (see Python 3.7 End-of-Life and Upgrading to Python 3.11 #2445 and https://github.com/orgs/ReactionMechanismGenerator/projects/11/views/1?layout=board) which will make doing this easier, so we will implement this new loader based on that work..py
files to the new.yaml
format? I suspect this would be more difficult than it seems, and it is not a significant burden to ask people to rewrite their input files in the new simpler format (IMO, welcome thoughts here).The text was updated successfully, but these errors were encountered: