From 625ad4b414799e68a0bcac32707794756f9d1239 Mon Sep 17 00:00:00 2001 From: Sevy Harris Date: Tue, 3 Mar 2026 12:15:15 -0500 Subject: [PATCH 1/2] Read core species from external dictionary Sometimes there are too many species to comfortably fit in one input file. This lets you outsource them to an external species dictionary so the input.py file can stay small enough to handle. --- rmgpy/rmg/input.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rmgpy/rmg/input.py b/rmgpy/rmg/input.py index 97399c0dd0..a6237b5228 100644 --- a/rmgpy/rmg/input.py +++ b/rmgpy/rmg/input.py @@ -40,6 +40,7 @@ from rmgpy.data.vaporLiquidMassTransfer import ( liquidVolumetricMassTransferCoefficientPowerLaw, ) +from rmgpy.chemkin import load_species_dictionary from rmgpy.exceptions import DatabaseError, InputError from rmgpy.molecule import Molecule from rmgpy.molecule.fragment import Fragment @@ -234,6 +235,15 @@ def convert_binding_energies(binding_energies): return new_dict +def core_species_file(species_dictionary_file): + # all species here are assumed to be reactive + new_species_dict = load_species_dictionary(species_dictionary_file) + for key in new_species_dict: + label = new_species_dict[key].label + structure = new_species_dict[key].molecule[0] + species(label, structure, reactive=True, cut=False, size_threshold=None) + + def species(label, structure, reactive=True, cut=False, size_threshold=None): logging.debug('Found {0} species "{1}" ({2})'.format('reactive' if reactive else 'nonreactive', label, @@ -1667,6 +1677,7 @@ def read_input_file(path, rmg0): 'False': False, 'database': database, 'catalystProperties': catalyst_properties, + 'coreSpeciesFile': core_species_file, 'species': species, 'forbidden': forbidden, 'SMARTS': smarts, From 2f1a5b63f64cc4ad8252f0c02eb1420222b4be07 Mon Sep 17 00:00:00 2001 From: Sevy Harris Date: Tue, 3 Mar 2026 12:17:02 -0500 Subject: [PATCH 2/2] Add core species list usage to documentation Adds an example of how to use the coreSpeciesList option in an input file to read in core species from an external species dictionary --- documentation/source/users/rmg/input.rst | 8 ++++++++ documentation/source/users/rmg/output.rst | 3 +++ 2 files changed, 11 insertions(+) diff --git a/documentation/source/users/rmg/input.rst b/documentation/source/users/rmg/input.rst index ba0d5a9ca1..4e3dc28a53 100644 --- a/documentation/source/users/rmg/input.rst +++ b/documentation/source/users/rmg/input.rst @@ -322,6 +322,14 @@ The following is an example of a typical species item, based on methane using SM """ ) +For long lists of initial core species, you can specify a coreSpeciesList, shown below:: + + coreSpeciesList( + species_dictionary_file="path/to/your/species_dictionary.txt" + ) + +This specifies the path for an RMG-formatted :ref:`species dictionary ` from which additional species will be loaded. Note that RMG will complain if any species in the input file is duplicated in the species dictionary. + .. _forbidden_structures: Forbidden Structures diff --git a/documentation/source/users/rmg/output.rst b/documentation/source/users/rmg/output.rst index 632a7fca75..ca8037779d 100755 --- a/documentation/source/users/rmg/output.rst +++ b/documentation/source/users/rmg/output.rst @@ -17,6 +17,9 @@ You will see that a sucessfully executed RMG job will create multiple output fil ``/species`` ``RMG.log`` + +.. _the_chemkin_folder: + ------------------ The Chemkin Folder ------------------