diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000000..aae2702499b
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,16 @@
+# https://editorconfig.org/
+root = true
+
+# Default settings for all files.
+[*]
+end_of_line = lf
+insert_final_newline = true
+charset = utf-8
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = true
+max_line_length = 120
+
+# Set indent size for json and YAML files.
+[*.{json,yml,yaml}]
+indent_size = 2
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index ec9da68e969..a058bdaf38a 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -18,7 +18,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
- python-version: "3.9"
+ python-version: '3.x'
- name: Install dependencies
run: |
@@ -31,7 +31,7 @@ jobs:
ruff format --check .
- name: mypy
- run: mypy ${{ github.event.repository.name }}
+ run: mypy src
- name: pyright
run: pyright
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 377fe28e21a..b6d5930dd17 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -35,11 +35,11 @@ jobs:
resolution: highest
extras: ci,optional
- os: ubuntu-latest
- python: "3.12"
+ python: '>3.9'
resolution: lowest-direct
extras: ci,optional
- os: macos-latest
- python: "3.10"
+ python: '3.10'
resolution: lowest-direct
extras: ci # test with only required dependencies installed
@@ -77,7 +77,7 @@ jobs:
micromamba activate pmg
# TODO remove temporary fix. added since uv install torch is flaky.
# track https://github.com/astral-sh/uv/issues/1921 for resolution
- pip install torch
+ pip install torch --upgrade
uv pip install numpy cython
uv pip install --editable '.[${{ matrix.config.extras }}]' --resolution=${{ matrix.config.resolution }}
diff --git a/.gitignore b/.gitignore
index 21e0621b8fb..2ac37aea6df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,3 +40,4 @@ venv/
ENV/
env.bak/
venv.bak/
+.pdm-python
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 0c66fbd86bf..bba0fa50a46 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -2,16 +2,16 @@ exclude: ^(docs|tests/files|tasks.py)
ci:
autoupdate_schedule: monthly
- skip: [mypy, pyright]
+ skip: [ mypy, pyright ]
autofix_commit_msg: pre-commit auto-fixes
autoupdate_commit_msg: pre-commit autoupdate
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.4.8
+ rev: v0.5.0
hooks:
- id: ruff
- args: [--fix, --unsafe-fixes]
+ args: [ --fix, --unsafe-fixes ]
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -22,7 +22,7 @@ repos:
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-mypy
- rev: v1.10.0
+ rev: v1.10.1
hooks:
- id: mypy
@@ -30,19 +30,20 @@ repos:
rev: v2.3.0
hooks:
- id: codespell
- stages: [commit, commit-msg]
- exclude_types: [html]
- additional_dependencies: [tomli] # needed to read pyproject.toml below py3.11
+ stages: [ commit, commit-msg ]
+ exclude_types: [ html ]
+ additional_dependencies: [ tomli ] # needed to read pyproject.toml below py3.11
+ exclude: src/pymatgen/analysis/aflow_prototypes.json
- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.16.2
hooks:
- id: cython-lint
- args: [--no-pycodestyle]
+ args: [ --no-pycodestyle ]
- id: double-quote-cython-strings
- repo: https://github.com/adamchainz/blacken-docs
- rev: 1.16.0
+ rev: 1.18.0
hooks:
- id: blacken-docs
@@ -55,15 +56,15 @@ repos:
# MD033: no inline HTML
# MD041: first line in a file should be a top-level heading
# MD025: single title
- args: [--disable, MD013, MD024, MD025, MD033, MD041, "--"]
+ args: [ --disable, MD013, MD024, MD025, MD033, MD041, "--" ]
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
- args: [--drop-empty-cells, --keep-output]
+ args: [ --drop-empty-cells, --keep-output ]
- repo: https://github.com/RobertCraigie/pyright-python
- rev: v1.1.366
+ rev: v1.1.369
hooks:
- id: pyright
diff --git a/dev_scripts/chemenv/explicit_permutations.py b/dev_scripts/chemenv/explicit_permutations.py
index f3225fa5293..097e80b25e0 100644
--- a/dev_scripts/chemenv/explicit_permutations.py
+++ b/dev_scripts/chemenv/explicit_permutations.py
@@ -10,7 +10,6 @@
import os
import numpy as np
-
from pymatgen.analysis.chemenv.coordination_environments.coordination_geometries import (
AllCoordinationGeometries,
ExplicitPermutationsAlgorithm,
diff --git a/dev_scripts/chemenv/explicit_permutations_plane_algorithm.py b/dev_scripts/chemenv/explicit_permutations_plane_algorithm.py
index bd71080c300..689ae58d86a 100644
--- a/dev_scripts/chemenv/explicit_permutations_plane_algorithm.py
+++ b/dev_scripts/chemenv/explicit_permutations_plane_algorithm.py
@@ -9,7 +9,6 @@
import json
import numpy as np
-
from pymatgen.analysis.chemenv.coordination_environments.coordination_geometries import AllCoordinationGeometries
from pymatgen.analysis.chemenv.coordination_environments.coordination_geometry_finder import (
AbstractGeometry,
diff --git a/dev_scripts/chemenv/get_plane_permutations_optimized.py b/dev_scripts/chemenv/get_plane_permutations_optimized.py
index ef92a27e63e..127ca009f19 100644
--- a/dev_scripts/chemenv/get_plane_permutations_optimized.py
+++ b/dev_scripts/chemenv/get_plane_permutations_optimized.py
@@ -15,7 +15,6 @@
import numpy as np
import tabulate
-
from pymatgen.analysis.chemenv.coordination_environments.coordination_geometries import AllCoordinationGeometries
from pymatgen.analysis.chemenv.coordination_environments.coordination_geometry_finder import (
AbstractGeometry,
@@ -236,7 +235,7 @@ def random_permutations_iterator(initial_permutation, n_permutations):
sym_measures = [c["symmetry_measure"] for c in csms]
prt1(string="Continuous symmetry measures", printing_volume=printing_volume)
prt1(string=sym_measures, printing_volume=printing_volume)
- csms_with_recorded_permutation = [] # type: ignore
+ csms_with_recorded_permutation: list = []
explicit_permutations = []
for icsm, csm in enumerate(csms):
found = False
@@ -308,7 +307,6 @@ def random_permutations_iterator(initial_permutation, n_permutations):
all_planes_point_indices += algo.other_plane_points
# Setup of the permutations to be used for this algorithm
-
indices = list(range(cg.coordination_number))
if permutations_setup_type == "all":
perms_iterator = itertools.permutations(indices)
@@ -400,7 +398,8 @@ def random_permutations_iterator(initial_permutation, n_permutations):
else:
perms_used[some_perm] = 1
tcurrent = time.process_time()
- time_left = (n_permutations - idx_perm) * (tcurrent - t0) / idx_perm # type: ignore
+ assert n_permutations is not None
+ time_left = (n_permutations - idx_perm) * (tcurrent - t0) / idx_perm
time_left = f"{time_left:.1f}"
idx_perm += 1
print(
diff --git a/dev_scripts/chemenv/strategies/multi_weights_strategy_parameters.py b/dev_scripts/chemenv/strategies/multi_weights_strategy_parameters.py
index 495a8bb668e..70449d924f8 100644
--- a/dev_scripts/chemenv/strategies/multi_weights_strategy_parameters.py
+++ b/dev_scripts/chemenv/strategies/multi_weights_strategy_parameters.py
@@ -8,7 +8,6 @@
import matplotlib.pyplot as plt
import numpy as np
-
from pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies import (
AngleNbSetWeight,
CNBiasNbSetWeight,
diff --git a/dev_scripts/chemenv/test_algos.py b/dev_scripts/chemenv/test_algos.py
index dbffdce27e5..17933a067a3 100644
--- a/dev_scripts/chemenv/test_algos.py
+++ b/dev_scripts/chemenv/test_algos.py
@@ -8,7 +8,6 @@
from random import shuffle
import numpy as np
-
from pymatgen.analysis.chemenv.coordination_environments.coordination_geometries import AllCoordinationGeometries
from pymatgen.analysis.chemenv.coordination_environments.coordination_geometry_finder import (
AbstractGeometry,
diff --git a/dev_scripts/chemenv/view_environment.py b/dev_scripts/chemenv/view_environment.py
index 2caa22e9f34..69aa6adc42e 100644
--- a/dev_scripts/chemenv/view_environment.py
+++ b/dev_scripts/chemenv/view_environment.py
@@ -3,7 +3,6 @@
from __future__ import annotations
import numpy as np
-
from pymatgen.analysis.chemenv.coordination_environments.coordination_geometries import (
SEPARATION_PLANE,
AllCoordinationGeometries,
diff --git a/dev_scripts/potcar_scrambler.py b/dev_scripts/potcar_scrambler.py
index 0dd2b0190fa..c0793c713d9 100644
--- a/dev_scripts/potcar_scrambler.py
+++ b/dev_scripts/potcar_scrambler.py
@@ -9,7 +9,6 @@
import numpy as np
from monty.os.path import zpath
from monty.serialization import zopen
-
from pymatgen.core import SETTINGS
from pymatgen.io.vasp import Potcar, PotcarSingle
from pymatgen.io.vasp.sets import _load_yaml_config
diff --git a/dev_scripts/update_pt_data.py b/dev_scripts/update_pt_data.py
index 09dcad5dd44..ee7889c75ea 100644
--- a/dev_scripts/update_pt_data.py
+++ b/dev_scripts/update_pt_data.py
@@ -11,9 +11,8 @@
import requests
from monty.dev import requires
from monty.serialization import dumpfn, loadfn
-from ruamel import yaml
-
from pymatgen.core import Element, get_el_sp
+from ruamel import yaml
try:
from bs4 import BeautifulSoup
@@ -30,8 +29,8 @@ def parse_oxi_state():
oxi_data = re.sub("[\n\r]", "", oxi_data)
patt = re.compile("
(.*?)
", re.MULTILINE)
- for m in patt.finditer(oxi_data):
- line = m.group(1)
+ for match in patt.finditer(oxi_data):
+ line = match[1]
line = re.sub("", "", line)
line = re.sub("(
)+", "
", line)
line = re.sub("*a[^>]*>", "", line)
@@ -39,15 +38,15 @@ def parse_oxi_state():
oxi_states = []
common_oxi = []
for tok in re.split("
", line.strip()):
- m2 = re.match(r"([A-Z][a-z]*)", tok)
- if m2:
- el = m2.group(1)
+ match2 = re.match(r"([A-Z][a-z]*)", tok)
+ if match2:
+ el = match2[1]
else:
- m3 = re.match(r"()*([\+\-]\d)()*", tok)
- if m3:
- oxi_states += [int(m3.group(2))]
- if m3.group(1):
- common_oxi += [int(m3.group(2))]
+ match3 = re.match(r"()*([\+\-]\d)()*", tok)
+ if match3:
+ oxi_states += [int(match3[2])]
+ if match3[1]:
+ common_oxi += [int(match3[2])]
if el in data:
del data[el]["Max oxidation state"]
del data[el]["Min oxidation state"]
@@ -79,7 +78,7 @@ def parse_ionic_radii():
ionic_radii = {}
for tok_idx in range(3, len(tokens)):
if match := re.match(r"^\s*([0-9\.]+)", tokens[tok_idx]):
- ionic_radii[int(header[tok_idx])] = float(match.group(1))
+ ionic_radii[int(header[tok_idx])] = float(match[1])
if el in data:
data[el][f"Ionic_radii{suffix}"] = ionic_radii
diff --git a/dev_scripts/update_spacegroup_data.py b/dev_scripts/update_spacegroup_data.py
new file mode 100644
index 00000000000..a4607cdbee7
--- /dev/null
+++ b/dev_scripts/update_spacegroup_data.py
@@ -0,0 +1,95 @@
+"""Script to update symm_ops.json and symm_data.yaml in symmetry module due to issues #3845 and #3862.
+symm_ops.json:
+- adds Hermann_mauguin point group key and short Hermann Mauguin space group symbol
+- converts screw axis notation to symm_data standard
+symm_data.json
+- removes mapping of rhombohedral space group types onto symbol + appended H
+- replaces I/P2_12_121 key with I/P2_12_12_1
+"""
+
+from __future__ import annotations
+
+import sys
+
+from monty.serialization import dumpfn, loadfn
+from pymatgen.symmetry.groups import PointGroup
+
+__author__ = "Katharina Ueltzen @kaueltzen"
+__date__ = "2024-06-06"
+
+SYMM_OPS = loadfn("../src/pymatgen/symmetry/symm_ops.json")
+SYMM_DATA = loadfn("../src/pymatgen/symmetry/symm_data.json")
+
+
+def convert_symmops_to_sg_encoding(symbol: str) -> str:
+ """
+ Utility function to convert SYMMOPS space group type symbol notation
+ into SYMM_DATA["space_group_encoding"] key notation with underscores before
+ translational part of screw axes.
+ Args:
+ symbol (str): "hermann_mauguin" or "universal_h_m" key of symmops.json
+ Returns:
+ symbol in the format of SYMM_DATA["space_group_encoding"] keys
+ """
+ symbol_representation = symbol.split(":")
+ representation = ":" + "".join(symbol_representation[1].split(" ")) if len(symbol_representation) > 1 else ""
+
+ blickrichtungen = symbol_representation[0].split(" ")
+ blickrichtungen_new = []
+ for br in blickrichtungen:
+ if len(br) > 1 and br[0].isdigit() and br[1].isdigit():
+ blickrichtungen_new.append(br[0] + "_" + br[1:])
+ else:
+ blickrichtungen_new.append(br)
+ return "".join(blickrichtungen_new) + representation
+
+
+def remove_identity_from_full_hermann_mauguin(symbol: str) -> str:
+ """
+ Utility function to remove identity along blickrichtung (except in P1).
+ Args:
+ symbol (str): "hermann_mauguin" key of symmops.json
+ Returns:
+ short "hermann_mauguin" key
+ """
+ if symbol in ("P 1", "C 1", "P 1 "):
+ return symbol
+ blickrichtungen = symbol.split(" ")
+ blickrichtungen_new = []
+ for br in blickrichtungen:
+ if br != "1":
+ blickrichtungen_new.append(br + " ")
+ return "".join(blickrichtungen_new)
+
+
+new_symm_data = {}
+for k, v in SYMM_DATA["space_group_encoding"].items():
+ if k.endswith("H"):
+ new_symm_data[k.removesuffix("H")] = v
+ elif k == "I2_12_121":
+ new_symm_data["I2_12_12_1"] = v
+ elif k == "P2_12_121":
+ new_symm_data["P2_12_12_1"] = v
+ else:
+ new_symm_data[k] = v
+
+SYMM_DATA["space_group_encoding"] = new_symm_data
+
+for spg_idx, spg in enumerate(SYMM_OPS):
+ if "(" in spg["hermann_mauguin"]:
+ SYMM_OPS[spg_idx]["hermann_mauguin"] = spg["hermann_mauguin"].split("(")[0]
+
+ short_h_m = remove_identity_from_full_hermann_mauguin(SYMM_OPS[spg_idx]["hermann_mauguin"])
+ SYMM_OPS[spg_idx]["short_h_m"] = convert_symmops_to_sg_encoding(short_h_m)
+ SYMM_OPS[spg_idx]["hermann_mauguin_u"] = convert_symmops_to_sg_encoding(spg["hermann_mauguin"])
+
+for spg_idx, spg in enumerate(SYMM_OPS):
+ try:
+ pg = PointGroup.from_space_group(spg["short_h_m"])
+ except AssertionError as e:
+ print(spg, str(e))
+ sys.exit(1)
+ SYMM_OPS[spg_idx]["point_group"] = pg.symbol
+
+dumpfn(SYMM_DATA, "../src/pymatgen/symmetry/symm_data.json")
+dumpfn(SYMM_OPS, "../src/pymatgen/symmetry/symm_ops.json")
diff --git a/docs/CHANGES.md b/docs/CHANGES.md
index 6b162785e8e..b080903b763 100644
--- a/docs/CHANGES.md
+++ b/docs/CHANGES.md
@@ -6,6 +6,14 @@ nav_order: 4
# Changelog
+## v2024.7.18
+- Fix `setuptools` for packaging (#3934)
+- Improve Keep Redundant Spaces algorithm for PatchedPhaseDiagram (#3900)
+- Add electronic structure methods for Species (#3902)
+- Migrate `spglib` to new `SpglibDataset` format with version 2.5.0 (#3923)
+- SpaceGroup changes (#3859)
+- Add MD input set to FHI-aims (#3896)
+
## v2024.6.10
* Fix bug in `update_charge_from_potcar` (#3866)
* Fix bug in VASP parameter parsing (@mkhorton)
diff --git a/docs/apidoc/conf.py b/docs/apidoc/conf.py
index 9e5eb5577f1..fe33a4e80b8 100644
--- a/docs/apidoc/conf.py
+++ b/docs/apidoc/conf.py
@@ -19,7 +19,7 @@
from pymatgen.core import __author__, __file__, __version__
project = "pymatgen"
-copyright = "2011, Materials Project"
+copyright = "2011, Materials Project" # noqa: A001
author = __author__
@@ -64,7 +64,7 @@
# General information about the project.
project = "pymatgen"
-copyright = f"2011, {__author__}"
+copyright = f"2011, {__author__}" # noqa: A001
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
diff --git a/docs/compatibility.md b/docs/compatibility.md
index 61bdee2354c..115ed7ebe7e 100644
--- a/docs/compatibility.md
+++ b/docs/compatibility.md
@@ -67,6 +67,24 @@ Windows and Linux.
## Recent Breaking Changes
+### v2024.?.?
+
+The `symbol` attribute of `SpaceGroup` now always refers to its Hermann-Mauguin symbol
+(see [#3859](https://github.com/materialsproject/pymatgen/pull/3859)). In order to replace
+the old symbol, run
+
+```py
+from pymatgen.symmetry.groups import SpaceGroup
+
+try:
+ new_symbol = SpaceGroup(old_symbol).symbol
+except ValueError:
+ if old_symbol in ["P2_12_121", "I2_12_121"]:
+ new_symbol = SpaceGroup(old_symbol[:-1]+"_1").symbol
+ else:
+ new_symbol = SpaceGroup(old_symbol[:-1]).symbol
+```
+
### v2024.5.31
* Update VASP sets to transition `atomate2` to use `pymatgen` input sets exclusively by @esoteric-ephemera in [#3835](https://github.com/materialsproject/pymatgen/pull/3835)
diff --git a/docs/contributing.md b/docs/contributing.md
index b568dacc247..3080cdb14d1 100644
--- a/docs/contributing.md
+++ b/docs/contributing.md
@@ -4,55 +4,91 @@ title: Contributing
nav_order: 6
---
-# Collaborative Github Workflow
+# Recommended developer workflow
-For developers interested in expanding `pymatgen` for their own purposes, we recommend forking `pymatgen` directly from the [`pymatgen` GitHub repo](https://github.com/materialsproject/pymatgen). Here's a typical workflow:
+For developers interested in expanding `pymatgen` for their own purposes, we recommend forking `pymatgen` directly from
+the [`pymatgen` GitHub repo](https://github.com/materialsproject/pymatgen). Here's a recommended workflow (updated Jun
+2024):
-1. Create a free GitHub account (if you don't already have one) and perform the necessary setup (e.g., install SSH keys etc.).
+1. Create a free GitHub account (if you don't already have one) and perform the necessary setup (e.g., install SSH keys
+ etc.).
-1. Fork the `pymatgen` GitHub repo, i.e., go to the main [`pymatgen` GitHub repo](https://github.com/materialsproject/pymatgen) and click fork to create a copy of the `pymatgen` code base on your own GitHub account.
+1. Fork the `pymatgen` GitHub repo, i.e., go to the
+ main [`pymatgen` GitHub repo](https://github.com/materialsproject/pymatgen) and click fork to create a copy of
+ the `pymatgen` code base on your own GitHub account.
1. Install `git` on your local machine (if you don't already have it).
-1. Clone *your forked repo* to your local machine. You will work mostly with your local repo and only publish changes when they are ready to be merged:
+1. Clone *your forked repo* to your local machine. You will work mostly with your local repo and only publish changes
+ when they are ready to be merged:
```sh
git clone https://github.com//pymatgen
+ cd pymatgen # Go into pmg directory.
```
- Note that the entire Github repo is fairly large because of the presence of test files, but these are necessary for rigorous testing.
+ Note that the entire Github repo is fairly large because of the presence of test files, but these are necessary for
+ rigorous testing.
+
+1. Install the [uv package manager](https://github.com/astral-sh/uv):
+
+ ```sh
+ pip install uv
+ ```
+
+1. Create a virtual env for pymatgen.
+
+ ```sh
+ uv create venv # A virtual env will be created in the .venv directory in the repo.
+ source .venv/bin/activate
+ ```
+
+1. Install pymatgen in editable mode with dev and optional dependencies:
+
+ ```sh
+ uv pip install -e '.[ci,optional]'
+ pre-commit install # Install pre-commit hook for linters.
+ ```
1. Make a new branch for your contributions
```sh
- git checkout -b my-new-fix-or-feature # should be run from up-to-date master
+ git checkout -b my-new-fix-or-feature # should be run from up-to-date master
```
-1. Code (see [Coding Guidelines](#coding-guidelines)). Commit early and commit often. Keep your code up to date. You need to add the main repository to the list of your remotes.
+1. Code (see [Coding Guidelines](#coding-guidelines)). Commit early and commit often. Keep your code up to date. You
+ need to add the main repository to the list of your remotes.
```sh
git remote add upstream https://github.com/materialsproject/pymatgen
```
- Make sure your repository is clean (no uncommitted changes) and is currently on the master branch. If not, commit or stash any changes and switch to the master.
+ Make sure your repository is clean (no uncommitted changes) and is currently on the master branch. If not, commit or
+ stash any changes and switch to the master.
```sh
git checkout master
```
- Then you can pull all the new commits from the main line
+ Then you can pull all the new commits from the main line
```sh
git pull upstream master
```
- Remember, pull is a combination of the commands fetch and merge, so there may be merge conflicts to be manually resolved.
+ Remember, pull is a combination of the commands fetch and merge, so there may be merge conflicts to be manually
+ resolved.
-1. Publish your contributions. Assuming that you now have a couple of commits that you would like to contribute to the main repository. Please follow the following steps:
+1. Publish your contributions. Assuming that you now have a couple of commits that you would like to contribute to the
+ main repository. Please follow the following steps:
- 1. If your change is based on a relatively old state of the main repository, then you should probably bring your repository up-to-date first to see if the change is not creating any merge conflicts.
+ 1. If your change is based on a relatively old state of the main repository, then you should probably bring your
+ repository up-to-date first to see if the change is not creating any merge conflicts.
- 1. Check that everything compiles cleanly and passes all tests. The `pymatgen` repo comes with a complete set of tests for all modules. If you have written new modules or methods, you must write tests for the new code as well (see [Coding Guidelines](#coding-guidelines)). Install and run `pytest` in your local repo directory and fix all errors before continuing further.
+ 1. Check that everything compiles cleanly and passes all tests. The `pymatgen` repo comes with a complete set of
+ tests for all modules. If you have written new modules or methods, you must write tests for the new code as
+ well (see [Coding Guidelines](#coding-guidelines)). Install and run `pytest` in your local repo directory and fix
+ all errors before continuing further.
1. If everything is ok, publish the commits to your GitHub repository.
@@ -60,25 +96,38 @@ For developers interested in expanding `pymatgen` for their own purposes, we rec
git push origin master
```
-1. Now that your commit is published, it doesn't mean that it has already been merged into the main repository. You should issue a merge request to `pymatgen` maintainers. They will pull your commits and run their own tests before releasing.
+1. Now that your commit is published, it doesn't mean that it has already been merged into the main repository. You
+ should issue a merge request to `pymatgen` maintainers. They will pull your commits and run their own tests before
+ releasing.
-"Work-in-progress" pull requests are encouraged, especially if this is your first time contributing to `pymatgen`, and the maintainers will be happy to help or provide code review as necessary. Put "\[WIP\]" in the title of your pull request to indicate it's not ready to be merged.
+"Work-in-progress" pull requests are encouraged, especially if this is your first time contributing to `pymatgen`, and
+the maintainers will be happy to help or provide code review as necessary. Put "\[WIP\]" in the title of your pull
+request to indicate it's not ready to be merged.
## Coding Guidelines
-Given that `pymatgen` is intended to be a long-term code base, we adopt very strict quality control and coding guidelines for all contributions to `pymatgen`. The following must be satisfied for your contributions to be accepted into `pymatgen`.
+Given that `pymatgen` is intended to be a long-term code base, we adopt very strict quality control and coding
+guidelines for all contributions to `pymatgen`. The following must be satisfied for your contributions to be accepted
+into `pymatgen`.
-1. **Unit tests** are required for all new modules and methods. The only way to minimize code regression is to ensure that all code is well tested. Untested contributions will not be accepted.
-1. **Python PEP 8** [code style](https://python.org/dev/peps/pep-0008). We allow a few exceptions when they are well-justified (e.g., Element's atomic number is given a variable name of capital Z, in line with accepted scientific convention), but generally, PEP 8 must be observed. Code style will be automatically checked for all PRs and must pass before any PR is merged. To aid you, you can install and run the same set of formatters and linters that will run in CI using
+1. **Unit tests** are required for all new modules and methods. The only way to minimize code regression is to ensure
+ that all code is well tested. Untested contributions will not be accepted.
+1. **Python PEP 8** [code style](https://python.org/dev/peps/pep-0008). We allow a few exceptions when they are
+ well-justified (e.g., Element's atomic number is given a variable name of capital Z, in line with accepted scientific
+ convention), but generally, PEP 8 must be observed. Code style will be automatically checked for all PRs and must
+ pass before any PR is merged. To aid you, you can install and run the same set of formatters and linters that will
+ run in CI using
```sh
pre-commit install # ensures linters are run prior to all future commits
pre-commit run --files path/to/changed/files # ensure your current uncommitted changes don't offend linters
# or
- pre-commit run --all-files # ensure your entire codebase passes linters
+ pre-commit run --all-files # ensure your entire codebase passes linters
```
-1. **Python 3**. We only support Python 3.8+.
-1. **Documentation** is required for all modules, classes and methods. In particular, the method doc strings should make clear the arguments expected and the return values. For complex algorithms (e.g., an Ewald summation), a summary of the algorithm should be provided and preferably with a link to a publication outlining the method in detail.
+1. **Python 3**. Check the `pyproject.toml` for the supported Python versions.
+1. **Documentation** is required for all modules, classes and methods. In particular, the method doc strings should make
+ clear the arguments expected and the return values. For complex algorithms (e.g., an Ewald summation), a summary of
+ the algorithm should be provided and preferably with a link to a publication outlining the method in detail.
For the above, if in doubt, please refer to the core classes in `pymatgen` for examples of what is expected.
diff --git a/docs/modules.html b/docs/modules.html
index 9b2c893e40b..45c32066fbe 100644
--- a/docs/modules.html
+++ b/docs/modules.html
@@ -4,7 +4,7 @@
- pymatgen — pymatgen 2024.6.4 documentation
+ pymatgen — pymatgen 2024.6.10 documentation
@@ -15,7 +15,7 @@
-
+
@@ -36,7 +36,7 @@