Skip to content

Change Input File Format from .py to .yaml #2634

@JacksonBurns

Description

@JacksonBurns

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:

  • 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.

etc.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions