Skip to content

Commit 214c8b2

Browse files
precommit
1 parent 2bd3286 commit 214c8b2

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

src/atomate2/forcefields/md.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from jobflow import job
1010

1111
from atomate2.ase.md import AseMDMaker, MDEnsemble
12-
from atomate2.forcefields.utils import _FORCEFIELD_DATA_OBJECTS, ForceFieldMixin
1312
from atomate2.forcefields.schemas import BaseForceFieldTaskDocument
13+
from atomate2.forcefields.utils import _FORCEFIELD_DATA_OBJECTS, ForceFieldMixin
1414

1515
if TYPE_CHECKING:
1616
from pathlib import Path

src/atomate2/forcefields/schemas.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,19 @@ class ForceFieldMeta(BaseModel):
5151
)
5252

5353
@property
54-
def forcefield_objects(self) -> Optional[dict[AseObject, Any]]:
54+
def forcefield_objects(self) -> dict[AseObject, Any] | None:
5555
"""Alias `objects` attr for backwards compatibility."""
5656
return self.objects
5757

5858

5959
class ForceFieldTaskDocument(AseStructureTaskDoc, ForceFieldMeta):
6060
"""Document containing information on structure manipulation using a force field."""
6161

62+
6263
class ForceFieldMoleculeTaskDocument(AseMoleculeTaskDoc, ForceFieldMeta):
6364
"""Document containing information on structure manipulation using a force field."""
6465

66+
6567
class BaseForceFieldTaskDocument(AseTaskDoc):
6668
"""Document containing information on structure manipulation using a force field."""
6769

@@ -94,7 +96,7 @@ class BaseForceFieldTaskDocument(AseTaskDoc):
9496
)
9597

9698
@classmethod
97-
def from_ase_compatible_result(
99+
def from_ase_compatible_result( # type: ignore[override]
98100
cls,
99101
ase_calculator_name: str,
100102
result: AseResult,

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def sr_ti_o3_structure(test_dir):
121121
def ba_ti_o3_structure(test_dir):
122122
return Structure.from_file(test_dir / "structures" / "BaTiO3.cif")
123123

124+
124125
@pytest.fixture(autouse=True)
125126
def mock_jobflow_settings(memory_jobstore):
126127
"""Mock the jobflow settings to use our specific jobstore (with data store)."""

tests/forcefields/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def pytest_runtest_setup(item: Any) -> None:
2525
def get_deepmd_pretrained_model_path(test_dir: Path) -> Path:
2626
# Download DeepMD pretrained model from GitHub
2727
file_url = "https://raw.github.com/sliutheorygroup/UniPero/main/model/graph.pb"
28-
local_path = tempfile.NamedTemporaryFile(suffix=".pb")
28+
local_path = tempfile.NamedTemporaryFile(suffix=".pb") # noqa : SIM115
2929
ref_md5 = "2814ae7f2eb1c605dd78f2964187de40"
3030
_, http_message = urllib.request.urlretrieve(file_url, local_path.name) # noqa: S310
3131
if "Content-Type: text/html" in http_message:

tests/forcefields/test_jobs.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,7 @@ def test_mace_relax_maker(
302302
assert output1.output.n_steps == 7
303303

304304

305-
def test_mace_mpa_0_relax_maker(si_structure: Structure, test_dir : Path, tmp_dir):
306-
305+
def test_mace_mpa_0_relax_maker(si_structure: Structure, test_dir: Path, tmp_dir):
307306
job = ForceFieldRelaxMaker(
308307
force_field_name="MACE_MPA_0",
309308
steps=25,
@@ -541,7 +540,9 @@ def test_nequip_relax_maker(
541540
assert final_spg_num == 99
542541

543542

544-
def test_deepmd_static_maker(sr_ti_o3_structure: Structure, test_dir: Path, get_deepmd_pretrained_model_path):
543+
def test_deepmd_static_maker(
544+
sr_ti_o3_structure: Structure, test_dir: Path, get_deepmd_pretrained_model_path
545+
):
545546
importorskip("deepmd")
546547

547548
# generate job
@@ -571,7 +572,7 @@ def test_deepmd_relax_maker(
571572
test_dir: Path,
572573
relax_cell: bool,
573574
fix_symmetry: bool,
574-
get_deepmd_pretrained_model_path : Path,
575+
get_deepmd_pretrained_model_path: Path,
575576
):
576577
importorskip("deepmd")
577578
# translate one atom to ensure a small number of relaxation steps are taken

tests/forcefields/test_phonon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_supercell_orthorhombic(clean_dir, si_structure: Structure):
5555

5656

5757
def test_phonon_maker_initialization_with_all_mlff(
58-
si_structure: Structure, test_dir: Path, get_deepmd_pretrained_model_path : Path
58+
si_structure: Structure, test_dir: Path, get_deepmd_pretrained_model_path: Path
5959
):
6060
"""Test PhononMaker can be initialized with all MLFF static and relax makers."""
6161

0 commit comments

Comments
 (0)