Skip to content

Commit

Permalink
Support an extra_energy_term flag
Browse files Browse the repository at this point in the history
This makes it possible to adjust energies by hand if needed (i.e., a
correction performed by an external program, etc.).
  • Loading branch information
schneiderfelipe committed Feb 28, 2022
1 parent 645578c commit 777155c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions overreact/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,13 @@ def parse_compounds(text, path=("",), select=None):
# TODO(schneiderfelipe): this workaround still allow unused compounds
# to be parsed! This should change in the future.
compounds = {name: compounds[name] for name in select}

# Apply `extra_energy_term`s
for name in compounds:
if "extra_energy_term" in compounds[name]:
# TODO: this assumes that 1. there's a single `extra_energy_term` and 2. `energy` is present
compounds[name]["energy"] += compounds[name]["extra_energy_term"]

return dotdict(compounds)


Expand Down

0 comments on commit 777155c

Please sign in to comment.