Skip to content

Commit 777155c

Browse files
Support an extra_energy_term flag
This makes it possible to adjust energies by hand if needed (i.e., a correction performed by an external program, etc.).
1 parent 645578c commit 777155c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

overreact/io.py

+7
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,13 @@ def parse_compounds(text, path=("",), select=None):
563563
# TODO(schneiderfelipe): this workaround still allow unused compounds
564564
# to be parsed! This should change in the future.
565565
compounds = {name: compounds[name] for name in select}
566+
567+
# Apply `extra_energy_term`s
568+
for name in compounds:
569+
if "extra_energy_term" in compounds[name]:
570+
# TODO: this assumes that 1. there's a single `extra_energy_term` and 2. `energy` is present
571+
compounds[name]["energy"] += compounds[name]["extra_energy_term"]
572+
566573
return dotdict(compounds)
567574

568575

0 commit comments

Comments
 (0)