-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d939f22
commit a7298a8
Showing
4 changed files
with
192 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import pandas | ||
|
||
from yammbs._base.base import ImmutableModel | ||
|
||
|
||
class LogSSE(ImmutableModel): | ||
id: int | ||
value: float | ||
|
||
|
||
class LogSSECollection(list[LogSSE]): | ||
def to_dataframe(self) -> pandas.DataFrame: | ||
return pandas.DataFrame( | ||
[log_sse.value for log_sse in self], | ||
index=pandas.Index([log_sse.id for log_sse in self]), | ||
columns=["value"], | ||
) | ||
|
||
def to_csv(self, path: str): | ||
self.to_dataframe().to_csv(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from __future__ import annotations | ||
|
||
from pydantic import Field | ||
|
||
from yammbs._base.array import Array | ||
from yammbs._base.base import ImmutableModel | ||
|
||
|
||
class MinimizedTorsionProfile(ImmutableModel): | ||
mapped_smiles: str | ||
dihedral_indices: list[int] = Field( | ||
..., | ||
description="The indices, 0-indexed, of the atoms which define the driven dihedral angle", | ||
) | ||
|
||
# TODO: Should this store more information than just the grid points and | ||
# final geometries? i.e. each point is tagged with an ID in QCArchive | ||
coordinates: dict[float, Array] = Field( | ||
..., | ||
description="A mapping between the grid angle and atomic coordinates, in Angstroms, of the molecule " | ||
"at that point in the torsion scan.", | ||
) | ||
|
||
energies: dict[float, float] = Field( | ||
..., | ||
description="A mapping between the grid angle and (QM) energies, in kcal/mol, of the molecule " | ||
"at that point in the torsion scan.", | ||
) | ||
|
||
|
||
class MinimizedTorsionDataset(ImmutableModel): | ||
tag: str = Field("QCArchive dataset", description="A tag for the dataset") | ||
|
||
version: int = Field(1, description="The version of this model") | ||
|
||
mm_torsions: dict[str, list[MinimizedTorsionProfile]] = Field( | ||
dict(), | ||
description="Torsion profiles minimized with MM, keyed by the force field.", | ||
) | ||
|
||
|
||
class Metric(ImmutableModel): | ||
log_sse: float # stand-in quantity for what metrics scientists care about | ||
|
||
|
||
class MetricCollection(ImmutableModel): | ||
metrics: dict[str, dict[int, Metric]] = Field( | ||
dict(), | ||
description="The metrics, keyed by the QM reference ID, then keyed by force field.", | ||
) |