Skip to content

Commit e3b2330

Browse files
authored
Merge branch 'main' into torchsim
2 parents 589fc35 + ccdf013 commit e3b2330

File tree

96 files changed

+709
-346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+709
-346
lines changed

.github/workflows/deploy.yml

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

2222
- uses: actions/setup-python@v5
2323
with:
24-
python-version: "3.10"
24+
python-version: "3.11"
2525
cache: pip
2626
cache-dependency-path: pyproject.toml
2727

@@ -51,7 +51,7 @@ jobs:
5151

5252
- uses: actions/setup-python@v5
5353
with:
54-
python-version: "3.10"
54+
python-version: "3.11"
5555

5656
- name: Build
5757
run: |

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
- uses: actions/setup-python@v5
2828
with:
29-
python-version: "3.10"
29+
python-version: "3.11"
3030
cache: pip
3131
cache-dependency-path: pyproject.toml
3232

.github/workflows/testing.yml

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- uses: actions/setup-python@v5
1919
with:
20-
python-version: "3.10"
20+
python-version: "3.11"
2121
cache: pip
2222
cache-dependency-path: pyproject.toml
2323

@@ -39,7 +39,7 @@ jobs:
3939
shell: bash -l {0} # enables conda/mamba env activation by reading bash profile
4040
strategy:
4141
matrix:
42-
python-version: ["3.10", "3.11", "3.12"]
42+
python-version: ["3.11", "3.12"]
4343
split: [1, 2, 3]
4444

4545
steps:
@@ -48,10 +48,11 @@ jobs:
4848

4949
- name: Set up micromamba
5050
uses: mamba-org/setup-micromamba@main
51-
52-
- name: Create mamba environment
53-
run: |
54-
micromamba create -n a2 python=${{ matrix.python-version }} --yes
51+
with:
52+
environment-name: a2
53+
cache-environment: false
54+
create-args: >-
55+
python=${{ matrix.python-version }}
5556
5657
- name: Install uv
5758
run: micromamba run -n a2 pip install uv
@@ -91,7 +92,7 @@ jobs:
9192
9293
9394
- uses: codecov/codecov-action@v1
94-
if: matrix.python-version == '3.10' && github.repository == 'materialsproject/atomate2'
95+
if: matrix.python-version == '3.11' && github.repository == 'materialsproject/atomate2'
9596
with:
9697
token: ${{ secrets.CODECOV_TOKEN }}
9798
name: coverage${{ matrix.split }}
@@ -113,18 +114,19 @@ jobs:
113114
shell: bash -l {0} # enables conda/mamba env activation by reading bash profile
114115
strategy:
115116
matrix:
116-
python-version: ["3.10","3.11","3.12"]
117+
python-version: ["3.11","3.12"]
117118

118119
steps:
119120
- name: Check out repo
120121
uses: actions/checkout@v4
121122

122123
- name: Set up micromamba
123124
uses: mamba-org/setup-micromamba@main
124-
125-
- name: Create mamba environment
126-
run: |
127-
micromamba create -n a2 python=${{ matrix.python-version }} --yes
125+
with:
126+
environment-name: a2
127+
cache-environment: false
128+
create-args: >-
129+
python=${{ matrix.python-version }}
128130
129131
- name: Install uv
130132
run: micromamba run -n a2 pip install uv
@@ -174,18 +176,19 @@ jobs:
174176
shell: bash -l {0} # enables conda/mamba env activation by reading bash profile
175177
strategy:
176178
matrix:
177-
python-version: ["3.10", "3.11", "3.12"]
179+
python-version: ["3.11", "3.12"]
178180

179181
steps:
180182
- name: Check out repo
181183
uses: actions/checkout@v4
182184

183185
- name: Set up micromamba
184186
uses: mamba-org/setup-micromamba@main
185-
186-
- name: Create mamba environment
187-
run: |
188-
micromamba create -n a2 python=${{ matrix.python-version }} --yes
187+
with:
188+
environment-name: a2
189+
cache-environment: false
190+
create-args: >-
191+
python=${{ matrix.python-version }}
189192
190193
- name: Install uv
191194
run: micromamba run -n a2 pip install uv
@@ -220,7 +223,7 @@ jobs:
220223
pytest -n auto --splits 1 --group 1 --cov=atomate2 --cov-report=xml tests/ase
221224
222225
- uses: codecov/codecov-action@v1
223-
if: matrix.python-version == '3.10' && github.repository == 'materialsproject/atomate2'
226+
if: matrix.python-version == '3.11' && github.repository == 'materialsproject/atomate2'
224227
with:
225228
token: ${{ secrets.CODECOV_TOKEN }}
226229
file: ./coverage.xml
@@ -241,18 +244,19 @@ jobs:
241244
shell: bash -l {0} # enables conda/mamba env activation by reading bash profile
242245
strategy:
243246
matrix:
244-
python-version: ["3.10", "3.11", "3.12"]
247+
python-version: ["3.11", "3.12"]
245248

246249
steps:
247250
- name: Check out repo
248251
uses: actions/checkout@v4
249252

250253
- name: Set up micromamba
251254
uses: mamba-org/setup-micromamba@main
252-
253-
- name: Create mamba environment
254-
run: |
255-
micromamba create -n a2 python=${{ matrix.python-version }} --yes
255+
with:
256+
environment-name: a2
257+
cache-environment: false
258+
create-args: >-
259+
python=${{ matrix.python-version }}
256260
257261
- name: Install uv
258262
run: micromamba run -n a2 pip install uv
@@ -292,7 +296,7 @@ jobs:
292296
293297
294298
- uses: codecov/codecov-action@v1
295-
if: matrix.python-version == '3.10' && github.repository == 'materialsproject/atomate2'
299+
if: matrix.python-version == '3.11' && github.repository == 'materialsproject/atomate2'
296300
with:
297301
token: ${{ secrets.CODECOV_TOKEN }}
298302
name: coverage
@@ -308,7 +312,7 @@ jobs:
308312

309313
- uses: actions/setup-python@v5
310314
with:
311-
python-version: "3.10"
315+
python-version: "3.11"
312316
cache: pip
313317
cache-dependency-path: pyproject.toml
314318

.github/workflows/update-precommit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Python
1616
uses: actions/setup-python@v5
1717
with:
18-
python-version: "3.10"
18+
python-version: "3.11"
1919

2020
- name: Install pre-commit
2121
run: pip install pre-commit

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ docs_build/*
88
docs/tutorials/*
99
docs/tutorials/*/*
1010

11+
# tutorial output files
12+
tutorials/*.json.gz
13+
1114
# C extensions
1215
*.so
1316

@@ -76,3 +79,6 @@ docs/reference/atomate2.*
7679

7780
.ipynb_checkpoints
7881
.aider*
82+
83+
# deepmd-kit files
84+
**/*.pb

docs/user/codes/forcefields.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(codes.forcefields)=
2+
3+
# Machine Learning forcefields / interatomic potentials
4+
5+
`atomate2` includes an interface to a few common machine learning interatomic potentials (MLIPs), also known variously as machine learning forcefields (MLFFs), or foundation potentials (FPs) for universal variants.
6+
Support is provided for the following models, which can be selected using `atomate2.forcefields.utils.MLFF`, as shown in the table below.
7+
**You need only install packages for the forcefields you wish to use.**
8+
9+
| Forcefield Name | `MLFF` | Reference | Description |
10+
| ---- | ---- | ---- | ---- |
11+
| CHGNet | `CHGNet` | [10.1038/s42256-023-00716-3](https://doi.org/10.1038/s42256-023-00716-3) | Available via the `chgnet` and `matgl` packages |
12+
| DeepMD | `MLFF.DeepMD` | [10.1103/PhysRevB.108.L180104](https://doi.org/10.1103/PhysRevB.108.L180104) | The Deep Potential model used for this test is `UniPero`, a universal interatomic potential for perovskite oxides. It can be downloaded [here](https://github.com/sliutheorygroup/UniPero) |
13+
| Gaussian Approximation Potential (GAP) | `GAP` | [10.1103/PhysRevLett.104.136403](https://doi.org/10.1103/PhysRevLett.104.136403) | Relies on `quippy-ase` package |
14+
| M3GNet | `M3GNet` | [10.1038/s43588-022-00349-3](https://doi.org/10.1038/s43588-022-00349-3) | Relies on `matgl` package |
15+
| MACE-MP-0 | `MACE` or `MACE_MP_0` (recommended) | [10.1063/5.0297006](https://doi.org/10.1063/5.0297006) | Relies on `mace_torch` and optionally `torch_dftd` packages |
16+
| MACE-MP-0b3 | `MACE_MP_0B3` | [10.1063/5.0297006](https://doi.org/10.1063/5.0297006) | Relies on `mace_torch` and optionally `torch_dftd` packages |
17+
| MACE-MPA-0 | `MACE_MPA_0` | [10.1063/5.0297006](https://doi.org/10.1063/5.0297006) | Relies on `mace_torch` and optionally `torch_dftd` packages |
18+
| MatPES-PBE | `MATPES_PBE` | [10.48550/arXiv.2503.04070](https://doi.org/10.48550/arXiv.2503.04070) | Relies on `matgl`. Defaults to TensorNet architecture, but can also use M3GNet or CHGNet architectures via kwargs. See `atomate2.forcefields.utils._DEFAULT_CALCULATOR_KWARGS` for more options. |
19+
| MatPES-r<sup>2</sup>SCAN | `MATPES_R2SCAN`| [10.48550/arXiv.2503.04070](https://doi.org/10.48550/arXiv.2503.04070) | Relies on `matgl`. Defaults to TensorNet architecture, but can also use M3GNet or CHGNet architectures via kwargs. See `atomate2.forcefields.utils._DEFAULT_CALCULATOR_KWARGS` for more options. |
20+
| Neuroevolution Potential (NEP) | `NEP` | [10.1103/PhysRevB.104.104309](https://doi.org/10.1103/PhysRevB.104.104309) | Relies on `calorine` package |
21+
| Neural Equivariant Interatomic Potentials (Nequip) | `Nequip` | [10.1038/s41467-022-29939-5](https://doi.org/10.1038/s41467-022-29939-5) | Relies on the `nequip` package |
22+
| SevenNet | `SevenNet` | [10.1021/acs.jctc.4c00190](https://doi.org/10.1021/acs.jctc.4c00190) | Relies on the `sevenn` package |

docs/user/codes/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ The section gives the instructions for codes supported by atomate2.
77
```{toctree}
88
vasp
99
openmm
10+
forcefields
1011
```

docs/user/install.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -354,19 +354,34 @@ and then return to this tutorial.
354354
### Materials Project API key
355355

356356
You can get an API key from the [Materials Project] by logging in and going to your
357-
[Dashboard](materials project). Add this also to
358-
your `~/.config/.pmgrc.yaml` so that it looks like the following
357+
[Dashboard](materials project).
359358

360-
```yaml
361-
PMG_VASP_PSP_DIR: <<INSTALL_DIR>>/pps
362-
PMG_MAPI_KEY: <<YOUR_API_KEY>>
359+
Add this to your `.bashrc`, `.zshrc`, etc. as an environment variable:
360+
```console
361+
export MP_API_KEY=your_api_key_here
363362
```
364363

365-
You can generate this file and set these values using the `pymatgen` CLI:
364+
## Emmet-core setup
366365

367-
```bash
368-
pmg config --add PMG_VASP_PSP_DIR /abs/path/to/psp PMG_MAPI_KEY your_api_key
366+
The `emmet-core` package is used to define data schemas for parsing outputs of workflows.
367+
It is also used in building the Materials Project data, therefore its use in `atomate2` is to broadly ensure compatibility with the Materials Project's data structures.
368+
`emmet-core` allows you to use either `pymatgen` or `emmet-core`-defined models for larger data objects, such as charge densities (`CHGCAR`, `AECCAR*`), or trajectories (relaxation, MD, etc.).
369+
The `pymatgen` objects have long been the default in workflows, and are structured to be output as JSON files.
370+
The `emmet-core` objects have been designed with both JSON and Apache parquet as storage formats.
371+
372+
If you will be storing data in the cloud, or would like to use these newer data models which may use less storage, you can either add a line to your `atomate2.yaml` file:
373+
```yaml
374+
VASP_USE_EMMET_MODELS: true
369375
```
376+
or use an environment variable in your `.bashrc`:
377+
```console
378+
export ATOMATE2_VASP_USE_EMMET_MODEL=true
379+
```
380+
Note that there is an equivalent `emmet-core` setting, which can be set by the environment variable `EMMET_USE_EMMET_MODELS`.
381+
382+
For ASE and machine learning forcefield jobs, you can use the `ASE_FORCEFIELD_USE_EMMET_MODELS` flag in `atomate2.yaml` to toggle the same functionality.
383+
384+
The default in `atomate2` is to use `pymatgen` models.
370385

371386
[materials project]: https://materialsproject.org/dashboard
372387

pyproject.toml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dependencies = [
2828
"PyYAML",
2929
"click",
3030
"custodian>=2024.4.18",
31-
"emmet-core>=v0.84.10",
31+
"emmet-core>=0.86.1",
3232
"jobflow>=0.1.11",
3333
"monty>=2024.12.10",
3434
"numpy",
@@ -57,11 +57,11 @@ forcefields = [
5757
"chgnet>=0.2.2",
5858
"mace-torch>=0.3.3",
5959
"matgl>=1.2.1",
60-
"torchdata<=0.7.1",
60+
"torchdata<=0.7.1", # TODO: remove when issue fixed
6161
# quippy-ase support for py3.12 tracked in https://github.com/libAtoms/QUIP/issues/645
6262
"quippy-ase>=0.9.14; python_version < '3.12'",
6363
"sevenn>=0.9.3",
64-
"torchdata<=0.7.1", # TODO: remove when issue fixed
64+
"deepmd-kit>=2.1.4",
6565
]
6666
torchsim = [
6767
"torch_sim==0.4.1",
@@ -86,7 +86,7 @@ docs = [
8686
"sphinx-copybutton==0.5.2",
8787
"sphinx==8.1.3",
8888
"sphinx_design==0.6.1",
89-
"jupyterlab==4.4.10",
89+
"jupyterlab==4.5.0",
9090
]
9191
dev = ["pre-commit>=2.12.1"]
9292
tests = [
@@ -102,22 +102,25 @@ strict-openff = [
102102
"mdanalysis==2.9.0",
103103
"monty==2025.3.3",
104104
"openmm-mdanalysis-reporter==0.1.0",
105-
"openmm==8.4.0",
105+
"openmm==8.4.0.post2",
106106
"pymatgen==2025.10.7", # EXERCISE CAUTION WHEN UPDATING - open ff is extremely sensitive to pymatgen version
107107
]
108108
strict-forcefields = [
109109
"calorine==3.2; python_version >= '3.12'",
110110
"calorine==3.1; python_version < '3.12'",
111111
"chgnet==0.3.8",
112112
"mace-torch==0.3.14",
113-
"matgl==1.3.0",
113+
"matgl==2.0.4",
114114
"quippy-ase==0.9.14; python_version < '3.12'",
115115
"sevenn==0.10.4",
116116
"torch==2.2.0",
117117
"torchdata==0.7.1", # TODO: remove when issue fixed
118+
"deepmd-kit==2.2.11",
119+
"tensorflow-cpu==2.16.2",
118120
]
119121
strict = [
120122
"atomate2[strict-forcefields, docs, cclib, phonons, lobster, openmm, mp, defects, ase, ase-ext]",
123+
"numpy<2.0",
121124
]
122125

123126
[project.scripts]

src/atomate2/abinit/schemas/calculation.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111
from abipy.flowtk import events
1212
from abipy.flowtk.utils import File
1313
from emmet.core.math import Matrix3D, Vector3D
14-
15-
try:
16-
from emmet.core.types.enums import ValueEnum
17-
except ImportError:
18-
from emmet.core.utils import ValueEnum
14+
from emmet.core.types.enums import ValueEnum
1915
from pydantic import BaseModel, Field
2016
from pymatgen.core import Structure
2117
from typing_extensions import Self

0 commit comments

Comments
 (0)