Skip to content

Commit a191fbd

Browse files
authored
use molecule.smiles instead of molecule.to_smiles() in yaml writer
This should speed up execution time by accessing the property each time instead of regenerating it, see : #2499 (comment)
1 parent 224936e commit a191fbd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

rmgpy/yml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def get_mech_dict(spcs, rxns, solvent='solvent', solvent_data=None):
9999

100100

101101
def get_radicals(spc):
102-
if spc.molecule[0].to_smiles() == "[O][O]": # treat oxygen as stable to improve radical analysis
102+
if spc.molecule[0].smiles == "[O][O]": # treat oxygen as stable to improve radical analysis
103103
return 0
104104
else:
105105
return spc.molecule[0].multiplicity-1
@@ -112,7 +112,7 @@ def obj_to_dict(obj, spcs, names=None, label="solvent"):
112112
result_dict["type"] = "Species"
113113
if obj.contains_surface_site():
114114
result_dict["adjlist"] = obj.molecule[0].to_adjacency_list()
115-
result_dict["smiles"] = obj.molecule[0].to_smiles()
115+
result_dict["smiles"] = obj.molecule[0].smiles
116116
result_dict["thermo"] = obj_to_dict(obj.thermo, spcs)
117117
result_dict["radicalelectrons"] = get_radicals(obj)
118118
if obj.liquid_volumetric_mass_transfer_coefficient_data:

0 commit comments

Comments
 (0)