Skip to content

Commit 7b81394

Browse files
committed
Use kcal/mol for OpenFF-Tors
1 parent 97f679a commit 7b81394

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

ml_peg/analysis/conformers/OpenFF_Tors/analyse_OpenFF_Tors.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from pathlib import Path
1111

12+
from ase import units
1213
from ase.io import read, write
1314
import pytest
1415

@@ -30,6 +31,8 @@
3031
METRICS_CONFIG_PATH
3132
)
3233

34+
EV_TO_KCAL = units.mol / units.kcal
35+
3336

3437
def labels() -> list:
3538
"""
@@ -52,8 +55,8 @@ def labels() -> list:
5255
@plot_parity(
5356
filename=OUT_PATH / "figure_openff_tors.json",
5457
title="Energies",
55-
x_label="Predicted energy / eV",
56-
y_label="Reference energy / eV",
58+
x_label="Predicted energy / kcal/mol",
59+
y_label="Reference energy / kcal/mol",
5760
hoverdata={
5861
"Labels": labels(),
5962
},
@@ -74,9 +77,9 @@ def conformer_energies() -> dict[str, list]:
7477
for label in labels():
7578
atoms = read(CALC_PATH / model_name / f"{label}.xyz")
7679

77-
results[model_name].append(atoms.info["model_rel_energy"])
80+
results[model_name].append(atoms.info["model_rel_energy"] * EV_TO_KCAL)
7881
if not ref_stored:
79-
results["ref"].append(atoms.info["ref_rel_energy"])
82+
results["ref"].append(atoms.info["ref_rel_energy"] * EV_TO_KCAL)
8083

8184
# Write structures for app
8285
structs_dir = OUT_PATH / model_name
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
metrics:
22
MAE:
33
good: 0.0
4-
bad: 1.0
5-
unit: eV
4+
bad: 20.0
5+
unit: kcal/mol
66
tooltip: Mean Absolute Error for all systems
77
level_of_theory: CCSD(T)

0 commit comments

Comments
 (0)