Skip to content

Commit a47b80d

Browse files
committed
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.
1 parent 6b1368d commit a47b80d

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

rmgpy/rmg/input.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from rmgpy.data.vaporLiquidMassTransfer import (
4141
liquidVolumetricMassTransferCoefficientPowerLaw,
4242
)
43+
from rmgpy.chemkin import load_species_dictionary
4344
from rmgpy.exceptions import DatabaseError, InputError
4445
from rmgpy.molecule import Molecule
4546
from rmgpy.molecule.fragment import Fragment
@@ -190,6 +191,16 @@ def convert_binding_energies(binding_energies):
190191
return new_dict
191192

192193

194+
def core_species_file(species_dictionary_file):
195+
# all species here are assumed to be reactive
196+
rmg.species_core_file = species_dictionary_file
197+
new_species_dict = load_species_dictionary(species_dictionary_file)
198+
for key in new_species_dict:
199+
label = new_species_dict[key].label
200+
structure = new_species_dict[key].molecule[0]
201+
species(label, structure, reactive=True, cut=False, size_threshold=None)
202+
203+
193204
def species(label, structure, reactive=True, cut=False, size_threshold=None):
194205
logging.debug('Found {0} species "{1}" ({2})'.format('reactive' if reactive else 'nonreactive',
195206
label,
@@ -1560,6 +1571,7 @@ def read_input_file(path, rmg0):
15601571
'False': False,
15611572
'database': database,
15621573
'catalystProperties': catalyst_properties,
1574+
'coreSpeciesFile': core_species_file,
15631575
'species': species,
15641576
'forbidden': forbidden,
15651577
'SMARTS': smarts,

0 commit comments

Comments
 (0)