Skip to content

Commit c4b66a7

Browse files
committed
Merge branch 'master' into pr/oashour/3463
2 parents 6f7939a + 45de1ae commit c4b66a7

File tree

1,992 files changed

+42351
-1403587
lines changed

Some content is hidden

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

1,992 files changed

+42351
-1403587
lines changed

.coderabbit.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
language: "en-US"
3+
early_access: false
4+
reviews:
5+
request_changes_workflow: false
6+
high_level_summary: false
7+
poem: false
8+
review_status: false
9+
collapse_walkthrough: false
10+
auto_review:
11+
enabled: true
12+
ignore_title_keywords:
13+
- "WIP"
14+
- "DO NOT MERGE"
15+
drafts: false
16+
chat:
17+
auto_reply: true

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# declare HTML, rST and test files as vendored/docs to exclude them when calculating repo languages on GitHub
22
tests/files/**/* linguist-vendored
3-
cmd_line/* linguist-vendored
43
docs/**/* linguist-generated
54
dev_scripts/**/* linguist-vendored

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
pymatgen/io/ase.py @Andrew-S-Rosen
33
pymatgen/io/abinit/* @gmatteo
44
pymatgen/io/lobster/* @JaGeo
5+
pymatgen/ext/* @ml-evs
6+
tests/ext/* @ml-evs

.github/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ changelog:
1414
labels: [housekeeping]
1515
- title: 🚀 Performance
1616
labels: [performance]
17+
- title: 🚧 CI
18+
labels: [ci]
1719
- title: 💡 Refactoring
1820
labels: [refactor]
1921
- title: 🧪 Tests
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Monthly issue metrics
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '3 2 1 * *'
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
build:
12+
name: issue metrics
13+
runs-on: ubuntu-latest
14+
permissions:
15+
issues: write
16+
pull-requests: read
17+
steps:
18+
- name: Get dates for last month
19+
shell: bash
20+
run: |
21+
# Calculate the first day of the previous month
22+
first_day=$(date -d "last month" +%Y-%m-01)
23+
24+
# Calculate the last day of the previous month
25+
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
26+
27+
#Set an environment variable with the date range
28+
echo "$first_day..$last_day"
29+
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
30+
31+
- name: Run issue-metrics tool
32+
uses: github/issue-metrics@v3
33+
env:
34+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
SEARCH_QUERY: 'repo:materialsproject/pymatgen is:issue created:${{ env.last_month }} -reason:"not planned"'
36+
37+
- name: Create issue
38+
uses: peter-evans/create-issue-from-file@v5
39+
with:
40+
title: Monthly issue metrics report
41+
token: ${{ secrets.GITHUB_TOKEN }}
42+
content-filepath: ./issue_metrics.md

.github/workflows/jekyll-gh-pages.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
21
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
32

43
on:
5-
# Runs on pushes targeting the default branch
64
push:
75
branches: ["master"]
6+
workflow_dispatch: # enable manual workflow execution
87

9-
# Allows you to run this workflow manually from the Actions tab
10-
workflow_dispatch:
11-
12-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
8+
# Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
139
permissions:
1410
contents: read
1511
pages: write
@@ -22,23 +18,26 @@ concurrency:
2218
cancel-in-progress: false
2319

2420
jobs:
25-
# Build job
2621
build:
22+
# prevent this action from running on forks
23+
if: github.repository == 'materialsproject/pymatgen'
2724
runs-on: ubuntu-latest
2825
steps:
2926
- name: Checkout
3027
uses: actions/checkout@v4
28+
3129
- name: Setup Pages
3230
uses: actions/configure-pages@v3
31+
3332
- name: Build with Jekyll
3433
uses: actions/jekyll-build-pages@v1
3534
with:
3635
source: ./docs
3736
destination: ./_site
37+
3838
- name: Upload artifact
3939
uses: actions/upload-pages-artifact@v2
4040

41-
# Deployment job
4241
deploy:
4342
environment:
4443
name: github-pages

.github/workflows/lint.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ jobs:
2222

2323
- name: Install dependencies
2424
run: |
25-
pip install --upgrade ruff mypy
25+
pip install --upgrade ruff mypy pyright
2626
2727
- name: ruff
2828
run: |
2929
ruff --version
30-
ruff .
30+
ruff check .
3131
ruff format --check .
3232
3333
- name: mypy
34-
run: |
35-
mypy --version
36-
rm -rf .mypy_cache
37-
mypy ${{ github.event.repository.name }}
34+
run: mypy ${{ github.event.repository.name }}
35+
36+
- name: pyright
37+
run: pyright

.github/workflows/release.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ jobs:
2929
- uses: actions/setup-python@v5
3030
name: Install Python
3131
with:
32-
python-version: "3.11"
33-
34-
- run: |
35-
python -m pip install build
36-
pip install -e .
32+
python-version: "3.12"
3733

3834
- name: Build sdist
39-
run: python -m build --sdist
35+
run: |
36+
pip install build
37+
python -m build --sdist
4038
4139
- uses: actions/upload-artifact@v3
4240
with:
@@ -47,7 +45,7 @@ jobs:
4745
strategy:
4846
matrix:
4947
os: [ubuntu-latest, macos-14, windows-latest]
50-
python-version: ["39", "310", "311"]
48+
python-version: ["39", "310", "311", "312"]
5149
runs-on: ${{ matrix.os }}
5250
steps:
5351
- name: Check out repo
@@ -70,10 +68,10 @@ jobs:
7068
# For pypi trusted publishing
7169
id-token: write
7270
steps:
73-
- name: Set up Python 3.11
71+
- name: Set up Python
7472
uses: actions/setup-python@v5
7573
with:
76-
python-version: 3.11
74+
python-version: "3.12"
7775

7876
- name: Get build artifacts
7977
uses: actions/download-artifact@v3

.github/workflows/test.yml

Lines changed: 33 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ on:
1010
branches: [master]
1111
paths-ignore: ["**/*.md", docs/**]
1212
workflow_dispatch:
13-
# make this workflow reusable by release.yml
14-
workflow_call:
13+
workflow_call: # make this workflow reusable by release.yml
1514

1615
permissions:
1716
contents: read
@@ -20,86 +19,67 @@ jobs:
2019
test:
2120
# prevent this action from running on forks
2221
if: github.repository == 'materialsproject/pymatgen'
22+
defaults:
23+
run:
24+
shell: bash -l {0} # enables conda/mamba env activation by reading bash profile
2325
strategy:
2426
fail-fast: false
2527
matrix:
2628
# pytest-split automatically distributes work load so parallel jobs finish in similar time
2729
os: [ubuntu-latest, windows-latest]
28-
python-version: ["3.9", "3.11"]
30+
python-version: ["3.9", "3.12"]
2931
split: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
3032
# include/exclude is meant to maximize CI coverage of different platforms and python
3133
# versions while minimizing the total number of jobs. We run all pytest splits with the
3234
# oldest supported python version (currently 3.9) on windows (seems most likely to surface
33-
# errors) and with newest version (currently 3.11) on ubuntu (to get complete and speedy
35+
# errors) and with newest version (currently 3.12) on ubuntu (to get complete and speedy
3436
# coverage on unix). We ignore mac-os, which is assumed to be similar to ubuntu.
3537
exclude:
3638
- os: windows-latest
37-
python-version: "3.11"
39+
python-version: "3.12"
3840
- os: ubuntu-latest
3941
python-version: "3.9"
4042

4143
runs-on: ${{ matrix.os }}
4244

4345
env:
4446
PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }}
45-
MPLBACKEND: Agg # https://github.com/orgs/community/discussions/26434
46-
PMG_TEST_FILES_DIR: ${{ github.workspace }}/tests/files
47-
GULP_LIB: ${{ github.workspace }}/cmd_line/gulp/Libraries
4847
PMG_VASP_PSP_DIR: ${{ github.workspace }}/tests/files
4948

5049
steps:
51-
- uses: actions/checkout@v4
52-
- name: Set up Python ${{ matrix.python-version }}
53-
uses: actions/setup-python@v5
54-
with:
55-
python-version: ${{ matrix.python-version }}
56-
cache: pip
57-
cache-dependency-path: setup.py
58-
- name: Copy GULP to bin
59-
if: matrix.os == 'ubuntu-latest'
60-
run: |
61-
sudo cp cmd_line/gulp/Linux_64bit/* /usr/local/bin/
62-
- name: Install Bader
63-
if: matrix.os == 'ubuntu-latest'
64-
run: |
65-
wget http://theory.cm.utexas.edu/henkelman/code/bader/download/bader_lnx_64.tar.gz
66-
tar xvzf bader_lnx_64.tar.gz
67-
sudo mv bader /usr/local/bin/
68-
continue-on-error: true # This is not critical to succeed.
69-
- name: Install Enumlib
70-
if: matrix.os == 'ubuntu-latest'
50+
- name: Check out repo
51+
uses: actions/checkout@v4
52+
53+
- name: Set up micromamba
54+
uses: mamba-org/setup-micromamba@main
55+
56+
- name: Create mamba environment
7157
run: |
72-
git clone --recursive https://github.com/msg-byu/enumlib.git
73-
cd enumlib/symlib/src
74-
export F90=gfortran
75-
make
76-
cd ../../src
77-
make enum.x
78-
sudo mv enum.x /usr/local/bin/
79-
cd ..
80-
sudo cp aux_src/makeStr.py /usr/local/bin/
81-
continue-on-error: true # This is not critical to succeed.
82-
- name: Install Packmol
58+
micromamba create -n pmg python=${{ matrix.python-version }} --yes
59+
60+
- name: Install uv
61+
run: micromamba run -n pmg pip install uv
62+
63+
- name: Install ubuntu-only conda dependencies
8364
if: matrix.os == 'ubuntu-latest'
8465
run: |
85-
wget -O packmol.tar.gz https://github.com/m3g/packmol/archive/refs/tags/v20.14.2.tar.gz
86-
tar xvzf packmol.tar.gz
87-
export F90=gfortran
88-
cd packmol-20.14.2
89-
./configure
90-
make
91-
sudo mv packmol /usr/local/bin/
92-
cd ..
93-
continue-on-error: true # This is not critical to succeed.
94-
- name: Install dependencies
66+
micromamba install -n pmg -c conda-forge enumlib packmol bader openbabel openff-toolkit --yes
67+
68+
- name: Install pymatgen and dependencies
9569
run: |
96-
python -m pip install numpy cython
70+
micromamba activate pmg
71+
# TODO remove temporary fix. added since uv install torch is flaky.
72+
# track https://github.com/astral-sh/uv/issues/1921 for resolution
73+
pip install torch
74+
75+
uv pip install numpy cython
9776
98-
# TODO remove next line installing ase from main branch until FrechetCellFilter is released
99-
pip install git+https://gitlab.com/ase/ase
77+
uv pip install --editable '.[dev,optional]'
10078
101-
python -m pip install -e '.[dev,optional]'
79+
# TODO remove next line installing ase from main branch when FrechetCellFilter is released
80+
uv pip install --upgrade 'git+https://gitlab.com/ase/ase'
10281
10382
- name: pytest split ${{ matrix.split }}
10483
run: |
84+
micromamba activate pmg
10585
pytest --splits 10 --group ${{ matrix.split }} --durations-path tests/files/.pytest-split-durations tests

.pre-commit-config.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
exclude: ^(docs|tests/files|cmd_line|tasks.py)
1+
exclude: ^(docs|tests/files|tasks.py)
22

33
ci:
44
autoupdate_schedule: monthly
5-
skip: [mypy]
5+
skip: [mypy, pyright]
66
autofix_commit_msg: pre-commit auto-fixes
77
autoupdate_commit_msg: pre-commit autoupdate
88

99
repos:
1010
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: v0.2.1
11+
rev: v0.4.2
1212
hooks:
1313
- id: ruff
1414
args: [--fix, --unsafe-fixes]
1515
- id: ruff-format
1616

1717
- repo: https://github.com/pre-commit/pre-commit-hooks
18-
rev: v4.5.0
18+
rev: v4.6.0
1919
hooks:
2020
- id: check-yaml
2121
- id: end-of-file-fixer
2222
- id: trailing-whitespace
2323

2424
- repo: https://github.com/pre-commit/mirrors-mypy
25-
rev: v1.8.0
25+
rev: v1.10.0
2626
hooks:
2727
- id: mypy
2828

@@ -35,7 +35,7 @@ repos:
3535
additional_dependencies: [tomli] # needed to read pyproject.toml below py3.11
3636

3737
- repo: https://github.com/MarcoGorelli/cython-lint
38-
rev: v0.16.0
38+
rev: v0.16.2
3939
hooks:
4040
- id: cython-lint
4141
args: [--no-pycodestyle]
@@ -62,3 +62,8 @@ repos:
6262
hooks:
6363
- id: nbstripout
6464
args: [--drop-empty-cells, --keep-output]
65+
66+
- repo: https://github.com/RobertCraigie/pyright-python
67+
rev: v1.1.360
68+
hooks:
69+
- id: pyright

0 commit comments

Comments
 (0)