Skip to content

Commit 5f5fedf

Browse files
committed
Merge branch 'main' of github.com:materialsproject/atomate2
pull trunk main
2 parents aeee107 + 95ea060 commit 5f5fedf

File tree

2,475 files changed

+421842
-13705
lines changed

Some content is hidden

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

2,475 files changed

+421842
-13705
lines changed

.github/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ changelog:
1313
- enhancement
1414
- title: Documentation 📖
1515
labels:
16-
- documentation
16+
- docs
1717
- title: House-Keeping 🧹
1818
labels:
1919
- house-keeping

.github/workflows/deploy.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ jobs:
2828
- name: Install dependencies
2929
run: |
3030
python -m pip install --upgrade pip
31-
# ase needed to get FrechetCellFilter used by ML force fields
32-
pip install git+https://gitlab.com/ase/ase
3331
pip install .[strict,docs]
3432
3533
- name: Build

.github/workflows/docs.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ jobs:
3333
- name: Install dependencies
3434
run: |
3535
python -m pip install --upgrade pip
36-
# ase needed to get FrechetCellFilter used by ML force fields
37-
pip install git+https://gitlab.com/ase/ase
3836
pip install .[strict,docs]
3937
4038
- name: Build

.github/workflows/testing.yml

Lines changed: 118 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
tags: ["v*"]
77
pull_request:
88
workflow_dispatch:
9+
repository_dispatch:
10+
types: [pymatgen-ci-trigger]
911

1012
jobs:
1113
lint:
@@ -15,54 +17,147 @@ jobs:
1517

1618
- uses: actions/setup-python@v5
1719
with:
18-
python-version: "3.9"
20+
python-version: "3.10"
1921
cache: pip
2022
cache-dependency-path: pyproject.toml
2123

2224
- uses: pre-commit/[email protected]
2325

24-
test:
26+
test-non-ase:
27+
# prevent this action from running on forks
28+
if: github.repository == 'materialsproject/atomate2'
29+
2530
services:
2631
local_mongodb:
2732
image: mongo:4.0
2833
ports:
2934
- 27017:27017
3035

3136
runs-on: ubuntu-latest
37+
defaults:
38+
run:
39+
shell: bash -l {0} # enables conda/mamba env activation by reading bash profile
3240
strategy:
3341
matrix:
34-
python-version: ["3.9", "3.10", "3.11"]
42+
python-version: ["3.10", "3.11", "3.12"]
43+
split: [1, 2, 3]
3544

3645
steps:
37-
- uses: actions/checkout@v4
46+
- name: Check out repo
47+
uses: actions/checkout@v4
3848

39-
- uses: actions/setup-python@v5
40-
with:
41-
python-version: ${{ matrix.python-version }}
49+
- name: Set up micromamba
50+
uses: mamba-org/setup-micromamba@main
51+
52+
- name: Create mamba environment
53+
run: |
54+
micromamba create -n a2 python=${{ matrix.python-version }} --yes
55+
56+
- name: Install uv
57+
run: micromamba run -n a2 pip install uv
4258

59+
- name: Install conda dependencies
60+
run: |
61+
micromamba install -n a2 -c conda-forge enumlib packmol bader openbabel openff-toolkit==0.16.2 openff-interchange==0.3.22 --yes
4362
4463
- name: Install dependencies
45-
# ERROR: Cannot install atomate2 and atomate2[strict,tests]==0.0.1 because these package versions have conflicting dependencies.
46-
# The conflict is caused by:
47-
# atomate2[strict,tests] 0.0.1 depends on pymatgen>=2023.10.4
48-
# atomate2[strict,tests] 0.0.1 depends on pymatgen==2023.10.4; extra == "strict"
49-
# ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
50-
# chgnet 0.2.1 depends on pymatgen>=2023.5.31
51-
# emmet-core 0.70.0 depends on pymatgen>=2023.10.11
5264
run: |
65+
micromamba activate a2
5366
python -m pip install --upgrade pip
5467
mkdir -p ~/.abinit/pseudos
5568
cp -r tests/test_data/abinit/pseudos/ONCVPSP-PBE-SR-PDv0.4 ~/.abinit/pseudos
56-
# ase needed to get FrechetCellFilter used by ML force fields
57-
pip install git+https://gitlab.com/ase/ase
58-
pip install .[strict,tests,abinit]
59-
pip install torch-runstats
60-
pip install --no-deps nequip
69+
uv pip install .[strict,strict-forcefields,tests,abinit]
70+
uv pip install torch-runstats
71+
uv pip install --no-deps nequip==0.5.6
72+
73+
- name: Install pymatgen from master if triggered by pymatgen repo dispatch
74+
if: github.event_name == 'repository_dispatch' && github.event.action == 'pymatgen-ci-trigger'
75+
run: |
76+
micromamba activate a2
77+
uv pip install --upgrade 'git+https://github.com/materialsproject/pymatgen@${{ github.event.client_payload.pymatgen_ref }}'
78+
79+
- name: Test split ${{ matrix.split }}
80+
env:
81+
MP_API_KEY: ${{ secrets.MP_API_KEY }}
82+
83+
# regenerate durations file with `pytest --store-durations --durations-path tests/.pytest-split-durations`
84+
# Note the use of `--splitting-algorithm least_duration`.
85+
# This helps prevent a test split having no tests to run, and then the GH action failing, see:
86+
# https://github.com/jerry-git/pytest-split/issues/95
87+
# However this `splitting-algorithm` means that tests cannot depend sensitively on the order they're executed in.
88+
run: |
89+
micromamba activate a2
90+
pytest --splits 3 --group ${{ matrix.split }} --durations-path tests/.pytest-split-durations --splitting-algorithm least_duration --ignore=tests/ase --cov=atomate2 --cov-report=xml
91+
92+
- uses: codecov/codecov-action@v1
93+
if: matrix.python-version == '3.10' && github.repository == 'materialsproject/atomate2'
94+
with:
95+
token: ${{ secrets.CODECOV_TOKEN }}
96+
name: coverage${{ matrix.split }}
97+
file: ./coverage.xml
98+
99+
test-notebooks-and-ase:
100+
# prevent this action from running on forks
101+
if: github.repository == 'materialsproject/atomate2'
102+
103+
# It seems like anything torch-dependent and tblite can't be installed in the same environment
104+
# without the tblite tests failing in CI, see, e.g.:
105+
# https://github.com/tblite/tblite/issues/116
106+
# Outside of CI, having torch installed but not loaded seems not to affect tblite
107+
# Set off ASE tests here, where tblite-dependent tests live
108+
services:
109+
local_mongodb:
110+
image: mongo:4.0
111+
ports:
112+
- 27017:27017
113+
114+
runs-on: ubuntu-latest
115+
defaults:
116+
run:
117+
shell: bash -l {0} # enables conda/mamba env activation by reading bash profile
118+
strategy:
119+
matrix:
120+
python-version: ["3.10", "3.11", "3.12"]
121+
122+
steps:
123+
- name: Check out repo
124+
uses: actions/checkout@v4
125+
126+
- name: Set up micromamba
127+
uses: mamba-org/setup-micromamba@main
128+
129+
- name: Create mamba environment
130+
run: |
131+
micromamba create -n a2 python=${{ matrix.python-version }} --yes
132+
133+
- name: Install uv
134+
run: micromamba run -n a2 pip install uv
135+
136+
- name: Install conda dependencies
137+
run: |
138+
micromamba install -n a2 -c conda-forge enumlib packmol bader openbabel openff-toolkit==0.16.2 openff-interchange==0.3.22 --yes
139+
140+
- name: Install dependencies
141+
run: |
142+
micromamba activate a2
143+
python -m pip install --upgrade pip
144+
uv pip install .[strict,tests]
145+
146+
- name: Install pymatgen from master if triggered by pymatgen repo dispatch
147+
if: github.event_name == 'repository_dispatch' && github.event.action == 'pymatgen-ci-trigger'
148+
run: uv pip install --upgrade 'git+https://github.com/materialsproject/pymatgen@${{ github.event.client_payload.pymatgen_ref }}'
61149

62-
- name: Test
150+
- name: Test Notebooks
151+
run: |
152+
micromamba activate a2
153+
pytest --nbmake ./tutorials --ignore=./tutorials/openmm_tutorial.ipynb
154+
155+
- name: Test ASE
63156
env:
64157
MP_API_KEY: ${{ secrets.MP_API_KEY }}
65-
run: pytest --cov=atomate2 --cov-report=xml
158+
run: |
159+
micromamba activate a2
160+
pytest --splits 1 --group 1 --cov=atomate2 --cov-report=xml tests/ase
66161
67162
- uses: codecov/codecov-action@v1
68163
if: matrix.python-version == '3.10' && github.repository == 'materialsproject/atomate2'
@@ -85,15 +180,13 @@ jobs:
85180
- name: Install dependencies
86181
run: |
87182
python -m pip install --upgrade pip
88-
# ase needed to get FrechetCellFilter used by ML force fields
89-
pip install git+https://gitlab.com/ase/ase
90-
pip install .[strict,docs]
183+
pip install .[strict,strict-forcefields,docs]
91184
92185
- name: Build
93186
run: sphinx-build docs docs_build
94187

95188
automerge:
96-
needs: [lint, test, docs]
189+
needs: [lint, test-non-ase, test-notebooks-and-ase, docs]
97190
runs-on: ubuntu-latest
98191

99192
permissions:

.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.9
18+
python-version: "3.10"
1919

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

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,12 @@ docs/reference/atomate2.*
6464

6565
.DS_Store
6666

67+
# vim extensions
68+
*.swp
69+
*.swo
70+
6771
# see https://github.com/materialsproject/atomate2/issues/345
6872
*.doctrees*
73+
74+
.ipynb_checkpoints
75+
.aider*

.pre-commit-config.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ default_language_version:
33
exclude: ^(.github/|tests/test_data/abinit/)
44
repos:
55
- repo: https://github.com/charliermarsh/ruff-pre-commit
6-
rev: v0.3.5
6+
rev: v0.8.0
77
hooks:
88
- id: ruff
99
args: [--fix]
1010
- id: ruff-format
1111
- repo: https://github.com/pre-commit/pre-commit-hooks
12-
rev: v4.5.0
12+
rev: v5.0.0
1313
hooks:
1414
- id: check-yaml
1515
- id: fix-encoding-pragma
1616
args: [--remove]
1717
- id: end-of-file-fixer
1818
- id: trailing-whitespace
1919
- repo: https://github.com/asottile/blacken-docs
20-
rev: 1.16.0
20+
rev: 1.19.1
2121
hooks:
2222
- id: blacken-docs
2323
additional_dependencies: [black]
@@ -30,17 +30,25 @@ repos:
3030
- id: rst-directive-colons
3131
- id: rst-inline-touching-normal
3232
- repo: https://github.com/pre-commit/mirrors-mypy
33-
rev: v1.9.0
33+
rev: v1.13.0
3434
hooks:
3535
- id: mypy
3636
files: ^src/
3737
additional_dependencies:
3838
- tokenize-rt==4.1.0
3939
- types-paramiko
4040
- repo: https://github.com/codespell-project/codespell
41-
rev: v2.2.6
41+
rev: v2.3.0
4242
hooks:
4343
- id: codespell
44-
stages: [commit, commit-msg]
44+
stages: [pre-commit, commit-msg]
4545
args: [--ignore-words-list, 'titel,statics,ba,nd,te,atomate']
4646
types_or: [python, rst, markdown]
47+
- repo: https://github.com/kynan/nbstripout
48+
rev: 0.8.1
49+
hooks:
50+
- id: nbstripout
51+
args:
52+
- --drop-empty-cells
53+
- --strip-init-cells
54+
- --extra-keys=metadata.kernelspec

0 commit comments

Comments
 (0)