Skip to content

Commit e6cb35f

Browse files
Single source of truth for optional deps in pyproject.toml (#1036)
* ruff * fix PYI063 Use PEP 570 syntax for positional-only arguments * single source of truth for optional deps in pyproject.toml * revert to mace-torch==0.3.6, 0.3.7 still unreleased * fix typo defects -> phonons * lint --------- Co-authored-by: Aaron Kaplan <[email protected]> Co-authored-by: esoteric-ephemera <[email protected]>
1 parent a401cd2 commit e6cb35f

File tree

8 files changed

+17
-38
lines changed

8 files changed

+17
-38
lines changed

pyproject.toml

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ dependencies = [
4141
[project.optional-dependencies]
4242
abinit = ["abipy>=0.9.3"]
4343
amset = ["amset>=0.4.15", "pydash"]
44-
cclib = ["cclib"]
44+
cclib = ["cclib>=1.8.1"]
4545
mp = ["mp-api>=0.37.5"]
4646
phonons = ["phonopy>=1.10.8", "seekpath>=2.0.0"]
4747
lobster = ["ijson>=3.2.2", "lobsterpy>=0.4.0"]
@@ -94,30 +94,6 @@ tests = [
9494
"pytest-xdist==3.8.0",
9595
"pytest==8.4.1",
9696
]
97-
strict = [
98-
"PyYAML==6.0.2",
99-
"ase==3.26.0",
100-
"cclib==1.8.1",
101-
"click==8.2.1",
102-
"custodian==2025.8.13",
103-
"dscribe==2.1.1",
104-
"emmet-core==v0.84.10rc2",
105-
"ijson==3.4.0",
106-
"jobflow==0.2.0",
107-
"lobsterpy==0.5.7",
108-
"monty==2025.3.3",
109-
"mp-api==0.45.8",
110-
"numpy",
111-
"phonopy==2.30.1",
112-
"pydantic-settings==2.10.1",
113-
"pydantic==2.11.7",
114-
"pymatgen-analysis-defects==2025.1.18",
115-
"pymatgen==2025.6.14",
116-
"pymongo==4.10.1",
117-
"python-ulid==3.1.0",
118-
"seekpath==2.1.0",
119-
"typing-extensions==4.14.1",
120-
]
12197
strict-openff = [
12298
"mdanalysis==2.9.0",
12399
"monty==2025.3.3",
@@ -135,6 +111,9 @@ strict-forcefields = [
135111
"torch==2.2.0",
136112
"torchdata==0.7.1", # TODO: remove when issue fixed
137113
]
114+
strict = [
115+
"atomate2[strict-forcefields, docs, cclib, phonons, lobster, openmm, mp, defects, ase, ase-ext]",
116+
]
138117

139118
[project.scripts]
140119
atm = "atomate2.cli:cli"

src/atomate2/ase/jobs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import logging
66
import time
7-
from abc import ABCMeta, abstractmethod
7+
from abc import ABC, abstractmethod
88
from dataclasses import dataclass, field
99
from typing import TYPE_CHECKING
1010

@@ -31,7 +31,7 @@
3131

3232

3333
@dataclass
34-
class AseMaker(Maker, metaclass=ABCMeta):
34+
class AseMaker(Maker, ABC):
3535
"""
3636
Define basic template of ASE-based jobs.
3737

src/atomate2/ase/md.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import os
99
import sys
1010
import time
11-
from abc import ABCMeta, abstractmethod
11+
from abc import ABC, abstractmethod
1212
from collections.abc import Sequence
1313
from dataclasses import dataclass, field
1414
from enum import Enum
@@ -82,7 +82,7 @@ class DynamicsPresets(Enum):
8282

8383

8484
@dataclass
85-
class AseMDMaker(AseMaker, metaclass=ABCMeta):
85+
class AseMDMaker(AseMaker, ABC):
8686
"""
8787
Perform MD with the Atomic Simulation Environment (ASE).
8888

src/atomate2/ase/schemas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class AseBaseModel(BaseModel):
103103
structure: Structure | None = Field(None, description="The structure at this step.")
104104
molecule: Molecule | None = Field(None, description="The molecule at this step.")
105105

106-
def model_post_init(self, _context: Any) -> None:
106+
def model_post_init(self, context: Any, /) -> None:
107107
"""Establish alias to structure and molecule fields."""
108108
if self.structure is None and isinstance(self.mol_or_struct, Structure):
109109
self.structure = self.mol_or_struct

src/atomate2/common/flows/mpmorph.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from __future__ import annotations
1515

16-
from abc import ABCMeta, abstractmethod
16+
from abc import ABC, abstractmethod
1717
from dataclasses import dataclass, field
1818
from typing import TYPE_CHECKING, Literal
1919

@@ -160,6 +160,7 @@ def make(
160160
deformed_structures[index].final_structure,
161161
prev_dir=None,
162162
)
163+
163164
relaxed_vol = len(working_outputs["relax"]["volume"])
164165
md_job.name = f"{self.name} {md_job.name} {relaxed_vol + 1}"
165166

@@ -180,7 +181,7 @@ def make(
180181

181182

182183
@dataclass
183-
class MPMorphMDMaker(Maker, metaclass=ABCMeta):
184+
class MPMorphMDMaker(Maker, ABC):
184185
"""Base MPMorph flow for amorphous solid equilibration.
185186
186187
This flow uses NVT molecular dynamics to:
@@ -391,7 +392,7 @@ def make(
391392

392393

393394
@dataclass
394-
class SlowQuenchMaker(Maker, metaclass=ABCMeta):
395+
class SlowQuenchMaker(Maker, ABC):
395396
"""Slow quench from high to low temperature structures.
396397
397398
Quenches a provided structure with a molecular dynamics

src/atomate2/common/jobs/eos.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from abc import ABCMeta, abstractmethod
5+
from abc import ABC, abstractmethod
66
from typing import TYPE_CHECKING
77

88
import numpy as np
@@ -23,7 +23,7 @@
2323
from pymatgen.core import Structure
2424

2525

26-
class EOSPostProcessor(MSONable, metaclass=ABCMeta):
26+
class EOSPostProcessor(MSONable, ABC):
2727
"""
2828
Fit data to an EOS.
2929

src/atomate2/vasp/flows/ferroelectric.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ def make(
125125
add_interp_flow.output,
126126
)
127127

128-
jobs.append(add_interp_flow)
129-
jobs.append(pol_analysis)
128+
jobs += (add_interp_flow, pol_analysis)
130129

131130
return Flow(
132131
jobs=jobs,

tests/forcefields/flows/test_mpmorph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def test_mpmorph_mlff_maker(ff_name, si_structure, test_dir, clean_dir):
124124
)
125125
task_docs = {}
126126
for uuid, job_name in uuids.items():
127-
for _i, mp_job_name in enumerate(main_mp_morph_job_names):
127+
for mp_job_name in main_mp_morph_job_names:
128128
if mp_job_name in job_name:
129129
task_docs[mp_job_name] = response[uuid][1].output
130130
break

0 commit comments

Comments
 (0)