Skip to content

Commit

Permalink
Merge branch 'materialsproject:main' into taskdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
esoteric-ephemera authored Apr 2, 2024
2 parents b0aa7d2 + 43c9801 commit 242a4b0
Show file tree
Hide file tree
Showing 7 changed files with 418 additions and 117 deletions.
206 changes: 109 additions & 97 deletions docs/CHANGELOG.md

Large diffs are not rendered by default.

32 changes: 15 additions & 17 deletions emmet-api/requirements/deployment.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ bcrypt==4.1.2
# via paramiko
blinker==1.7.0
# via flask
boto3==1.34.69
boto3==1.34.74
# via
# emmet-api (emmet/emmet-api/setup.py)
# maggma
botocore==1.34.69
botocore==1.34.74
# via
# boto3
# s3transfer
Expand All @@ -55,17 +55,17 @@ cryptography==42.0.5
# via paramiko
cycler==0.12.1
# via matplotlib
ddsketch==2.0.4
ddsketch==3.0.1
# via ddtrace
ddtrace==2.7.4
ddtrace==2.7.5
# via emmet-api (emmet/emmet-api/setup.py)
deprecated==1.2.14
# via opentelemetry-api
dnspython==2.6.1
# via
# maggma
# pymongo
emmet-core==0.80.0
emmet-core==0.81.1
# via emmet-api (emmet/emmet-api/setup.py)
envier==0.5.1
# via ddtrace
Expand All @@ -91,7 +91,7 @@ idna==3.6
# via
# anyio
# requests
importlib-metadata==6.11.0
importlib-metadata==7.0.0
# via opentelemetry-api
itsdangerous==2.1.2
# via flask
Expand Down Expand Up @@ -125,7 +125,7 @@ mongogrant==0.3.3
# via maggma
mongomock==4.1.2
# via maggma
monty==2024.2.26
monty==2024.3.31
# via
# emmet-core
# maggma
Expand All @@ -147,9 +147,9 @@ numpy==1.26.4
# scipy
# shapely
# spglib
opentelemetry-api==1.23.0
opentelemetry-api==1.24.0
# via ddtrace
orjson==3.9.15
orjson==3.10.0
# via maggma
packaging==24.0
# via
Expand All @@ -165,19 +165,17 @@ pandas==2.2.1
# pymatgen
paramiko==3.4.0
# via sshtunnel
pillow==10.2.0
pillow==10.3.0
# via matplotlib
plotly==5.20.0
# via pymatgen
protobuf==5.26.0
# via
# ddsketch
# ddtrace
protobuf==5.26.1
# via ddtrace
pybtex==0.24.0
# via
# emmet-core
# pymatgen
pycparser==2.21
pycparser==2.22
# via cffi
pydantic==2.6.4
# via
Expand All @@ -191,15 +189,15 @@ pydantic-settings==2.2.1
# via
# emmet-core
# maggma
pydash==7.0.7
pydash==8.0.0
# via maggma
pymatgen==2024.3.1
# via
# emmet-core
# pymatgen-analysis-alloys
pymatgen-analysis-alloys==0.0.6
# via emmet-api (emmet/emmet-api/setup.py)
pymongo==4.6.2
pymongo==4.6.3
# via
# maggma
# mongogrant
Expand Down
2 changes: 1 addition & 1 deletion emmet-builders/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"emmet-core[all]",
"emmet-core[ml]",
"maggma>=0.57.6",
"matminer>=0.7.3",
"matminer>=0.9.1",
],
extras_require={
"test": [
Expand Down
74 changes: 74 additions & 0 deletions emmet-core/emmet/core/classical_md.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
"""Schemas for classical MD package."""

from __future__ import annotations

from dataclasses import dataclass
from datetime import datetime
from typing import Optional

from monty.json import MSONable

from emmet.core.vasp.task_valid import TaskState
from pydantic import BaseModel, Field


@dataclass
class MoleculeSpec(MSONable):
"""A molecule schema to be output by OpenMMGenerators."""

name: str
count: int
formal_charge: int
charge_method: str
openff_mol: str # a tk.Molecule object serialized with to_json

# @field_validator("openff_mol")
# @classmethod
# def _validate_openff_mol(cls, v: str) -> str:
# try:
# tk.Molecule.from_json(v)
# except Exception as e:
# raise ValueError(
# "MoleculeSpec.openff_mol must be able to be"
# "parsed with Molecule.from_json."
# ) from e
# return v


class ClassicalMDTaskDocument(BaseModel, extra="allow"): # type: ignore[call-arg]
"""Definition of the OpenMM task document."""

tags: Optional[list[str]] = Field(
[], title="tag", description="Metadata tagged to a given task."
)
dir_name: Optional[str] = Field(
None, description="The directory for this VASP task"
)
state: Optional[TaskState] = Field(None, description="State of this calculation")

calcs_reversed: Optional[list] = Field(
None,
title="Calcs reversed data",
description="Detailed data for each VASP calculation contributing to "
"the task document.",
)

interchange: Optional[str] = Field(
None, description="Final output structure from the task"
)

molecule_specs: Optional[list[MoleculeSpec]] = Field(
None, description="Molecules within the box."
)

forcefield: Optional[str] = Field(None, description="forcefield")

task_type: Optional[str] = Field(None, description="The type of calculation.")

# task_label: Optional[str] = Field(None, description="A description of the task")
# TODO: where does task_label get added

last_updated: Optional[datetime] = Field(
None,
description="Timestamp for the most recent calculation for this task document",
)
Empty file.
Loading

0 comments on commit 242a4b0

Please sign in to comment.