Skip to content
Merged

Sync #100

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d1ae6e8
Better comment handling for CP2K input file (#4443)
DanielYang59 Jun 30, 2025
ba211c4
Bump urllib3 from 2.2.3 to 2.5.0 (#4441)
dependabot[bot] Jun 30, 2025
309caa5
Add basic S3 object retrieval to the pymatgen user agent (#4438)
esoteric-ephemera Jun 30, 2025
f9d9fe8
Efficiency updates for `__str__()` methods (#4446)
kavanase Jul 3, 2025
4201994
Update analyzer.py (#4464)
boyoungzheng Jul 29, 2025
8ba4b6e
Handle numpy array for selective dynamics in `Structure` (#4461)
DanielYang59 Jul 29, 2025
5965e32
Cache macos/ubuntu optional dependency install in CI pipeline, enable…
DanielYang59 Jul 29, 2025
2e060a3
pre-commit autoupdate (#4450)
pre-commit-ci[bot] Jul 29, 2025
2f2c8d7
Fix unit for `Element` properties: `density_of_solid` and `Molar volu…
DanielYang59 Jul 29, 2025
fc5286e
Remove LOBSTER output file trailing line sensitivity (#4448)
DanielYang59 Jul 29, 2025
34f7f6e
Bump nokogiri from 1.18.8 to 1.18.9 in /docs (#4466)
dependabot[bot] Jul 29, 2025
00bf636
Add comment.
shyuep Jul 29, 2025
0d708d6
Merge branch 'master' of github.com:materialsproject/pymatgen
shyuep Jul 29, 2025
f01009c
Fix `ruff` PERF401: manual-list-comprehension (#4449)
DanielYang59 Jul 30, 2025
0f5c4af
patch ReDOS vulnerability: https://salsa.debian.org/debichem-team/pym…
lbluque Aug 13, 2025
1797d0c
Comment out alloys API test. Because MP API changes.
shyuep Aug 13, 2025
5b60b5e
Use external Package for FHI-aims IO interface (#4260)
tpurcell90 Aug 13, 2025
7233aa7
pre-commit autoupdate (#4474)
pre-commit-ci[bot] Aug 13, 2025
ebd8fea
Add alloys to optional.
shyuep Aug 13, 2025
12011a1
Fix label in `NEBAnalysis` (#4473)
DanielYang59 Aug 13, 2025
38997ee
Fix jdftx.outputs usage of 3.11+ only syntax (#4484)
DanielYang59 Aug 21, 2025
4f30bfa
Move JDFTx sets from atomate2 to pymatgen (#4479)
cote3804 Aug 21, 2025
c6c5780
Loosen `requests` lower pin, fix `pre-commit` errors (#4469)
DanielYang59 Aug 21, 2025
fd41fd1
Fix `has_cobicar` when NcICOBILIST is present (#4447)
tomdemeyere Aug 21, 2025
3651d5a
Remove dev-facing `ci` optional dependency, update markdown docs (#4463)
DanielYang59 Aug 22, 2025
117effe
Fix tests for lower.
shyuep Aug 22, 2025
3e06c93
Revert "Fix tests for lower."
shyuep Aug 22, 2025
90c3e59
Fix MPRester tests without alloys installed.
shyuep Aug 22, 2025
5b7273b
Use importlib find_spec.
shyuep Aug 22, 2025
74ff64b
Guess we have to use the old method.
shyuep Aug 22, 2025
d2454dc
Fix TranslateSitesTransformation (#4487)
Rastow Aug 25, 2025
7225790
Update uv.lock.
shyuep Aug 26, 2025
e715742
Merge branch 'master' of github.com:materialsproject/pymatgen
shyuep Aug 26, 2025
937115d
Fix type errors.
shyuep Aug 26, 2025
840ebc1
`JDFTXOutfileSlice.vibrational_modes` and `JDFTXOutfileSlice.vibratio…
benrich37 Sep 3, 2025
b622498
Replace `linear_assignment` with `scipy` `linear_sum_assignment ` (#4…
DanielYang59 Sep 3, 2025
fe485dc
pre-commit autoupdate (#4489)
pre-commit-ci[bot] Sep 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/_install_opt_unit_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
set -euo pipefail
set -x

# Use a custom bin directory for easier GitHub Actions caching
BIN_DIR="${1:-$PWD/opt/bin}" && mkdir -p "$BIN_DIR"

# Install BoltzTraP
wget --no-verbose -O BoltzTraP.tar.bz2 https://owncloud.tuwien.ac.at/index.php/s/s2d55LYlZnioa3s/download
tar -jxf BoltzTraP.tar.bz2
cp boltztrap-1.2.5/src/{BoltzTraP,x_trans} "$BIN_DIR"

# Install Vampire 5.0
# TODO: Accepts self-signed cert (https://github.com/richard-evans/vampire/issues/122)
wget --no-verbose --no-check-certificate https://vampire.york.ac.uk/resources/release-5/vampire-5.0-linux.tar.gz
tar -zxf vampire-5.0-linux.tar.gz && mv linux vampire-5.0
cp vampire-5.0/vampire-serial "$BIN_DIR"

# Install Voro++ and ZEO++
wget --no-verbose http://www.zeoplusplus.org/zeo++-0.3.tar.gz
tar -xzf zeo++-0.3.tar.gz
make -C zeo++-0.3/voro++/src -s CFLAGS="-w"
make -C zeo++-0.3 -s CFLAGS="-w"
cp zeo++-0.3/voro++/src/voro++ "$BIN_DIR"
cp zeo++-0.3/network "$BIN_DIR"

# Install mcsqs (from ATAT)
# TODO: cannot build on MacOS
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
wget --no-verbose https://axelvandewalle.github.io/www-avdw/atat/atat3_50.tar.gz
tar -zxf atat3_50.tar.gz

# Replace `BINDIR` in makefile
sed -i "s|^BINDIR=.*|BINDIR=$BIN_DIR|" atat/makefile

sudo apt install csh -y -q
make -C atat && make -C atat install
fi

# Add to path
echo "$BIN_DIR" >> "$GITHUB_PATH"
3 changes: 1 addition & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ jobs:
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: |
uv sync --group lint
uv pip install -e .
uv sync

- name: ruff
run: |
Expand Down
68 changes: 27 additions & 41 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
if: github.repository == 'materialsproject/pymatgen'
defaults:
run:
shell: bash -l {0} # Enable conda/mamba env activation by reading bash profile
shell: bash -leo pipefail {0} # Enable mamba env activation by reading bash profile
strategy:
fail-fast: false
matrix:
Expand All @@ -31,31 +31,29 @@ jobs:
# newest version (currently 3.13) on ubuntu (to get complete coverage on unix).
config:
- os: windows-latest
python: "3.11"
python: "3.10"
resolution: highest
extras: ci,optional,prototypes
extras: optional,prototypes
- os: windows-latest
python: "3.11"
resolution: highest
extras: ci,prototypes,optional,numpy-v1 # Test NP1 on Windows (quite buggy ATM)
- os: ubuntu-latest
python: "3.13"
resolution: lowest-direct
extras: ci,prototypes,optional
extras: prototypes,optional,numpy-v1 # Test NP1 on Windows (quite buggy ATM)
- os: macos-latest
python: "3.12"
resolution: lowest-direct
extras: ci,prototypes # test with only required dependencies installed
extras: prototypes # test with only required dependencies installed
- os: ubuntu-latest
python: "3.13"
resolution: lowest-direct
extras: prototypes,optional

# pytest-split automatically distributes work load so parallel jobs finish in similar time
# update durations file with `pytest --store-durations --durations-path tests/files/.pytest-split-durations`
split: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

runs-on: ${{ matrix.config.os }}
env:
MPLBACKEND: Agg # non-interactive backend for matplotlib
PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }}
PYTHONWARNDEFAULTENCODING: "true" # PEP 597: Enable optional EncodingWarning
OPT_BIN_DIR: ${{ github.workspace }}/opt/bin # for optional Unix dependencies
steps:
- name: Check out repo
uses: actions/checkout@v4
Expand All @@ -64,6 +62,7 @@ jobs:
uses: mamba-org/setup-micromamba@main
with:
environment-name: pmg
cache-environment: true
create-args: >-
python=${{ matrix.config.python }}

Expand All @@ -79,48 +78,34 @@ jobs:

- name: Install pymatgen and dependencies via uv
run: |
micromamba activate pmg

# Install from wheels to test the content
uv build --wheel --no-build-logs
WHEEL_FILE=$(ls dist/pymatgen*.whl)
uv pip install $WHEEL_FILE[${{matrix.config.extras}}] --resolution=${{matrix.config.resolution}}
uv pip install $WHEEL_FILE[${{matrix.config.extras}}] --group test \
--resolution=${{matrix.config.resolution}}

- name: Install DGL and MatGL specially on ubuntu.
if: matrix.config.os == 'ubuntu-latest' && matrix.config.python < '3.13'
run: |
micromamba activate pmg
pip install --upgrade dgl -f https://data.dgl.ai/wheels/torch-2.4/repo.html
pip install --upgrade matgl>=1.2.6
pip install torch==2.2.0 torchdata==0.7.1

- name: Install optional Ubuntu and macOS dependencies
- name: Restore cache for optional Ubuntu/MacOS dependencies
if: matrix.config.os == 'ubuntu-latest' || matrix.config.os == 'macos-latest'
run: |
# Install BoltzTraP
wget -q -O BoltzTraP.tar.bz2 https://owncloud.tuwien.ac.at/index.php/s/s2d55LYlZnioa3s/download
tar -jxf BoltzTraP.tar.bz2 && realpath boltztrap-1.2.5/src/ >> $GITHUB_PATH

# Install Vampire 5.0
wget -q https://vampire.york.ac.uk/resources/release-5/vampire-5.0-linux.tar.gz
tar -zxf vampire-5.0-linux.tar.gz && mv linux vampire-5.0
realpath vampire-5.0/ >> $GITHUB_PATH

# Install Voro++ and ZEO++
wget -q http://www.zeoplusplus.org/zeo++-0.3.tar.gz && tar -xzf zeo++-0.3.tar.gz
id: optbin-cache
uses: actions/cache@v4
with:
path: ${{ env.OPT_BIN_DIR }}
key: opt-bin-${{ runner.os }}-${{ hashFiles('.github/workflows/_install_opt_unit_deps.sh') }}

cd zeo++-0.3/voro++/src && make -s CFLAGS="-w" && realpath . >> $GITHUB_PATH && cd ../..
make -s CFLAGS="-w" && realpath . >> $GITHUB_PATH
- name: Build optional Ubuntu/MacOS dependencies (when cache misses)
if: (matrix.config.os == 'ubuntu-latest' || matrix.config.os == 'macos-latest') && steps.optbin-cache.outputs.cache-hit != 'true'
run: bash .github/workflows/_install_opt_unit_deps.sh "$OPT_BIN_DIR"

- name: pytest split ${{ matrix.split }}
env:
MPLBACKEND: Agg # non-interactive backend for matplotlib
PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }}
PMG_TEST_FILES_DIR: "${{ github.workspace }}/tests/files"
PYTHONWARNDEFAULTENCODING: "true" # PEP 597: Enable optional EncodingWarning
run: |
micromamba activate pmg

pytest --splits 10 --group ${{ matrix.split }} --durations-path tests/files/.pytest-split-durations tests
pytest tests \
--splits 10 --group ${{ matrix.split }} \
--durations-path tests/files/.pytest-split-durations \

trigger_atomate2_ci:
needs: test
Expand All @@ -141,6 +126,7 @@ jobs:
-d '{"event_type": "pymatgen-ci-trigger", "client_payload": {"pymatgen_ref": "${{ github.sha }}"}}'

all_pass:
# This step is added to indicate all the tests have passed to make it easier to do auto-merge of PRs.
needs: test
runs-on: ubuntu-latest
steps:
Expand Down
11 changes: 5 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,23 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.12
rev: v0.12.11
hooks:
- id: ruff
args: [--fix, --unsafe-fixes]
- id: ruff-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.16.0
rev: v1.17.1
hooks:
- id: mypy
additional_dependencies: [numpy>=1.2.5]

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
Expand All @@ -37,7 +36,7 @@ repos:
exclude: src/pymatgen/analysis/aflow_prototypes.json

- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.16.6
rev: v0.16.7
hooks:
- id: cython-lint
args: [--no-pycodestyle]
Expand Down Expand Up @@ -66,6 +65,6 @@ repos:
args: [--drop-empty-cells, --keep-output]

- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.401
rev: v1.1.404
hooks:
- id: pyright
20 changes: 5 additions & 15 deletions ADMIN.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,30 @@
# Introduction

This documentation provides a guide for `pymatgen` administrators. The following assumes you are using `miniconda`
or Anaconda.
This documentation provides a guide for `pymatgen` administrators.

## Releases

The general procedure for releasing `pymatgen` comprises the following steps:

1. Make sure all CI checks are green. We don't want to release known bugs.
2. Update changelog.
3. Run `invoke make-doc` to update the HTML docs.
3. Run `uv run invoke make-doc` to update the HTML docs.
4. Tag the latest commit with `git tag v<yyyy.mm.dd>`.
5. Make a GitHub release with auto-generated release notes.
6. Make sure the release action runs that publishes the new version to PyPI and conda-forge runs to completion.

## Initial setup

Pymatgen uses [invoke](https://pyinvoke.org) to automate releases.
You will also need `sphinx` and `doc2dash`.

```sh
pip install --upgrade invoke sphinx
```

## Doing the release

First update the change log. The autogenerated change log is simply a list of commit messages since the last version. Make sure to edit the log for brevity and to attribute significant features to appropriate developers:

```sh
invoke update-changelog
uv run invoke update-changelog
```

Then, do the release:

```sh
invoke release
uv run invoke release
```

Double check that the releases are properly done on Pypi.
Double check that the releases are properly done on PyPI.
102 changes: 0 additions & 102 deletions CONTRIBUTING.md

This file was deleted.

4 changes: 1 addition & 3 deletions dev_scripts/chemenv/get_plane_permutations_optimized.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ def random_permutations_iterator(initial_permutation, n_permutations):
continue
n_cols = 5
n_lines = int(np.ceil(float(len(sep_plane_cgs)) / n_cols))
sep_plane_cgs_grid = []
for _ in range(n_lines):
sep_plane_cgs_grid.append([""] * n_cols)
sep_plane_cgs_grid = [[""] * n_cols for _ in range(n_lines)]
for line_idx in range(n_lines):
for col_idx in range(n_cols):
ii = line_idx * n_cols + col_idx
Expand Down
Loading