Skip to content

Commit cd52908

Browse files
authored
Merge pull request #334 from naik-aakash/update-dependencies-workflow
Update dependencies & CI publish workflow
2 parents 4a5a3ce + 74ae9fe commit cd52908

Some content is hidden

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

61 files changed

+343
-25
lines changed

.github/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
changelog:
2+
exclude:
3+
authors: [ dependabot, github-actions ]
4+
labels: [automated-pr]
5+
categories:
6+
- title: 🚀 New Features
7+
labels:
8+
- enhancement
9+
- title: 🐛 Bug Fixes
10+
labels:
11+
- bug
12+
- title: Enhancements 🛠
13+
labels:
14+
- enhancement
15+
- title: 📚 Documentation
16+
labels:
17+
- documentation
18+
- title: 🧹 House-Keeping
19+
labels:
20+
- housekeeping
21+
- title: 🔄 Other Changes
22+
labels:
23+
- "*"

.github/workflows/docker-publish.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and Push Docker Image
33
on:
44
workflow_dispatch:
55
release:
6-
types: [ created ] # Runs only when a new release is created
6+
types: [ published ] # Runs only when a new release is published
77

88
jobs:
99
build-image:
@@ -36,10 +36,9 @@ jobs:
3636
run: |
3737
echo "IMAGE_NAME=`echo ${{github.repository}} | tr '[:upper:]' '[:lower:]'`" >>${GITHUB_ENV}
3838
39-
- name: Extract version from pyproject.toml
39+
- name: Extract version from release tag
4040
run: |
41-
VERSION=$(grep '^version = ' pyproject.toml | sed -E 's/version = "(.*)"/\1/')
42-
echo "VERSION=$VERSION" >> $GITHUB_ENV
41+
echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
4342
4443
# Build Docker image with a custom Python version
4544
- name: Build Docker image (Python ${{ matrix.python-version }})
@@ -53,7 +52,7 @@ jobs:
5352
docker push ghcr.io/${{ env.IMAGE_NAME }}/autoplex-python-${{ matrix.python-version }}:${{ env.VERSION }}
5453
5554
update-devcontainer:
56-
if: github.event_name == 'release' && github.event.action == 'created'
55+
if: github.event_name == 'release' && github.event.action == 'published'
5756
needs: build-image
5857
runs-on: ubuntu-latest
5958
steps:
@@ -89,5 +88,7 @@ jobs:
8988
title: Update devcontainer.json version tag
9089
body: Update devcontainer.json version tag to reflect release changes
9190
branch: update-devcontainer
91+
labels: |
92+
automated-pr
9293
delete-branch: true
9394
base: main

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
push:
66
branches: [ main ]
77
release:
8-
types: [ created ]
8+
types: [ published ]
99

1010
# set GITHUB_TOKEN permissions to allow deployment to GitHub Pages
1111
permissions:

.github/workflows/python-package.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ jobs:
3434
echo "VERSION=$TAG" >> $GITHUB_ENV
3535
3636
- uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0 # Fetch the entire Git history
39+
3740
- name: Run tests using Docker image for Python ${{ matrix.python-version }}
3841
run: |
3942
docker pull ghcr.io/autoatml/autoplex/autoplex-python-${{ matrix.python-version }}:${{ env.VERSION }}

.github/workflows/python-publish.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,48 @@ on:
1212
types: [published]
1313

1414
jobs:
15-
deploy:
15+
update-changelog:
1616
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout Repository
19+
uses: actions/checkout@v4
20+
21+
- name: Fetch Version Tag & Release Notes
22+
id: get_release_info
23+
run: |
24+
echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
25+
echo "NOTES<<EOF" >> $GITHUB_ENV
26+
gh release view ${{ github.event.release.tag_name }} --json body -q .body >> $GITHUB_ENV
27+
echo "EOF" >> $GITHUB_ENV
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Insert Version Tag & Release Notes Below `# Changelog`
32+
run: |
33+
{ echo "# Changelog"; echo; echo "## $VERSION"; echo; echo "$NOTES"; echo; tail -n +2 CHANGELOG.md; } > temp.md && mv temp.md CHANGELOG.md
34+
35+
- name: Create Pull Request to push updated CHANGELOG.md
36+
uses: peter-evans/create-pull-request@v7
37+
with:
38+
token: ${{ secrets.ACTION_SECRET }}
39+
commit-message: update CHANGELOG
40+
title: Update changelog with latest release notes
41+
body: Update CHANGELOG.md to reflect release changes
42+
branch: update-changelog
43+
labels: |
44+
automated-pr
45+
delete-branch: true
46+
base: main
1747

48+
deploy:
49+
needs: update-changelog
50+
runs-on: ubuntu-latest
1851
steps:
52+
- name: Pause for 5 minutes to merge update Changelog PR
53+
run: |
54+
echo "Wait for 5 minutes to merge PR..."
55+
sleep 300
56+
echo "Resuming workflow..."
1957
- uses: actions/checkout@v4
2058
- name: Set up Python
2159
uses: actions/setup-python@v4
@@ -29,4 +67,4 @@ jobs:
2967
uses: pypa/[email protected]
3068
with:
3169
user: __token__
32-
password: ${{ secrets.PYPI_API_TOKEN }}
70+
password: ${{ secrets.PYPI_API_TOKEN }}

pyproject.toml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[build-system]
22
requires = [
33
"setuptools>=65.0.0",
4+
"setuptools-scm>=8.0",
45
"wheel",
56
]
67
build-backend = "setuptools.build_meta"
@@ -12,7 +13,8 @@ readme = "README.md"
1213
keywords = ["high-throughput", "automated", "mlpotential"]
1314
license = { text = "GPL-3.0 license" }
1415
authors = [{ name = "Janine George", email = "[email protected]" }]
15-
version = "0.1.1"
16+
# version = "0.1.1"
17+
dynamic = ["version"]
1618
classifiers = [
1719
"Programming Language :: Python :: 3",
1820
"Programming Language :: Python :: 3.10",
@@ -24,7 +26,7 @@ classifiers = [
2426
requires-python = ">=3.10,<3.12"
2527
dependencies = [
2628
"pymatgen>=2024.9.17.1",
27-
"atomate2[strict]>=0.0.18",
29+
"atomate2[strict]>=0.0.19",
2830
"ase==3.23.0",
2931
"matgl==1.1.3",
3032
"mace-torch==0.3.9",
@@ -62,9 +64,13 @@ docs = [
6264
"sphinxcontrib-mermaid",
6365

6466
]
67+
workflow-managers = [
68+
"FireWorks==2.0.4",
69+
"jobflow-remote==0.1.5"
70+
]
6571
strict = [
66-
"pymatgen==2024.10.3", #?
67-
"atomate2[strict]==0.0.18",
72+
"pymatgen==2024.11.13", #?
73+
"atomate2[strict]==0.0.19",
6874
"matgl==1.1.3",
6975
"quippy-ase==0.9.14; python_version < '3.12'",
7076
"torch==2.2.1",
@@ -81,10 +87,7 @@ strict = [
8187
dev = ["pre-commit>=2.12.1"]
8288
tests = ["pytest", "pytest-mock", "pytest-split", "pytest-cov", "types-setuptools"]
8389

84-
[tool.versioningit.vcs]
85-
method = "git"
86-
default-tag = "0.0.1"
87-
90+
[tool.setuptools_scm]
8891

8992
[tool.cibuildwheel.linux]
9093
archs = ["auto64"]

tests/auto/phonons/test_jobs.py

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def test_get_output(clean_dir, test_dir, memory_jobstore):
133133

134134
responses = run_locally(job_here)
135135

136-
responses[job_here.uuid][1].output["rms"] == pytest.approx(0.1223)
136+
assert responses[job_here.uuid][1].output["rms"] == pytest.approx(0.1223, abs=0.00001)
137137

138138
input_dict = {"metrics": [[{"benchmark_phonon_rmse": 0.12230662063050536, "dft_imaginary_modes": True,
139139
"ml_imaginary_modes": False},
@@ -314,7 +314,7 @@ def test_dft_task_doc(
314314
mock_vasp(ref_paths, fake_run_vasp_kwargs)
315315

316316
# run the flow or job and ensure that it finished running successfully
317-
responses = run_locally(
317+
_ = run_locally(
318318
dft_phonon_workflow,
319319
create_folders=True,
320320
ensure_success=True,
@@ -331,12 +331,9 @@ def test_dft_task_doc(
331331
def test_dft_phonopy_gen_data_manual_supercell_matrix(
332332
vasp_test_dir,
333333
mock_vasp,
334-
test_dir,
335334
memory_jobstore,
336335
relax_maker,
337336
static_energy_maker,
338-
ref_paths_check_sc_mat,
339-
fake_run_vasp_kwargs,
340337
clean_dir
341338
):
342339
path_to_struct = vasp_test_dir / "dft_ml_data_generation" / "POSCAR"
@@ -358,10 +355,29 @@ def test_dft_phonopy_gen_data_manual_supercell_matrix(
358355
supercell_settings=supercell_settings)
359356

360357
# automatically use fake VASP and write POTCAR.spec during the test
361-
mock_vasp(ref_paths_check_sc_mat, fake_run_vasp_kwargs)
358+
ref_paths_manual_sc = {
359+
"dft tight relax 1": "dft_ml_data_generation/manual_sc/tight_relax_1/",
360+
"dft tight relax 2": "dft_ml_data_generation/manual_sc/tight_relax_2/",
361+
"dft static": "dft_ml_data_generation/manual_sc/static/",
362+
"dft phonon static 1/2": "dft_ml_data_generation/manual_sc/phonon_static_1/",
363+
"dft phonon static 2/2": "dft_ml_data_generation/manual_sc/phonon_static_2/",
364+
}
365+
366+
fake_run_vasp_manual_sc_kwargs = {
367+
"dft tight relax 1": {"incar_settings": ["NSW", "ISMEAR"]},
368+
"dft tight relax 2": {"incar_settings": ["NSW", "ISMEAR"]},
369+
"dft static": {"incar_settings": ["NSW", "ISMEAR"],
370+
"check_inputs": ["incar", "poscar", "potcar"]},
371+
"dft phonon static 1/2": {"incar_settings": ["NSW"],
372+
"check_inputs": ["incar", "poscar", "potcar"]},
373+
"dft phonon static 2/2": {"incar_settings": ["NSW"],
374+
"check_inputs": ["incar", "poscar", "potcar"]},
375+
}
376+
377+
mock_vasp(ref_paths_manual_sc, fake_run_vasp_manual_sc_kwargs)
362378

363379
# run the flow or job and ensure that it finished running successfully
364-
responses = run_locally(
380+
_ = run_locally(
365381
dft_phonon_workflow,
366382
create_folders=True,
367383
ensure_success=True,
@@ -375,7 +391,6 @@ def test_dft_phonopy_gen_data_manual_supercell_matrix(
375391
def test_dft_random_gen_data_manual_supercell_matrix(
376392
vasp_test_dir,
377393
mock_vasp,
378-
test_dir,
379394
memory_jobstore,
380395
relax_maker,
381396
ref_paths_check_sc_mat,
@@ -406,7 +421,7 @@ def test_dft_random_gen_data_manual_supercell_matrix(
406421
mock_vasp(ref_paths_check_sc_mat, fake_run_vasp_kwargs)
407422

408423
# run the flow or job and ensure that it finished running successfully
409-
responses = run_locally(
424+
_ = run_locally(
410425
dft_rattled_workflow,
411426
create_folders=True,
412427
ensure_success=True,
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
ALGO = Normal
2+
EDIFF = 1e-07
3+
ENAUG = 1360
4+
ENCUT = 700.0
5+
GGA = Ps
6+
IBRION = -1
7+
ISIF = 3
8+
ISMEAR = 0
9+
ISPIN = 1
10+
ISYM = 0
11+
KSPACING = 0.2
12+
LAECHG = False
13+
LASPH = True
14+
LCHARG = False
15+
LELF = False
16+
LMIXTAU = True
17+
LOPTICS = False
18+
LREAL = False
19+
LVTOT = False
20+
LWAVE = False
21+
NELM = 200
22+
NPAR = 4
23+
NSW = 0
24+
PREC = Accurate
25+
SIGMA = 0.05
26+
SYMPREC = 1e-09
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Li4 Cl4
2+
1.0
3+
5.0610971241896960 -0.0000006092523619 -0.0000003660074017
4+
-0.0000006092815283 5.0610988165144262 0.0000007954914030
5+
-0.0000003665234025 0.0000007959831166 5.0610955328987517
6+
Li Cl
7+
4 4
8+
direct
9+
1.0019758471283773 0.0000000143884762 0.0000000107516982 Li
10+
0.0000000034717687 0.4999999886037613 0.5000000122922756 Li
11+
0.5000000719600592 0.0000000248133745 0.4999999239567003 Li
12+
0.4999999835485269 0.4999999476935811 0.0000000407198897 Li
13+
0.5000001417092435 0.0000000296706020 0.0000000704553358 Cl
14+
0.4999999916177629 0.4999999860471361 0.4999998505436807 Cl
15+
0.9999998367678485 0.9999999911917783 0.4999999574638707 Cl
16+
0.9999999799704115 0.5000000175912831 0.0000001338165418 Cl
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Li_sv
2+
Cl

0 commit comments

Comments
 (0)