Skip to content

Commit 2d9ffbc

Browse files
committed
Merge branch 'master' of https://github.com/materialsproject/pymatgen into fix-chargemol-path
2 parents 8be153a + bb68c78 commit 2d9ffbc

File tree

246 files changed

+4431
-4669
lines changed

Some content is hidden

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

246 files changed

+4431
-4669
lines changed

.coderabbit.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,21 @@ jobs:
8383
run: |
8484
micromamba activate pmg
8585
pytest --splits 10 --group ${{ matrix.split }} --durations-path tests/files/.pytest-split-durations tests
86+
87+
trigger_atomate2_ci:
88+
needs: test
89+
runs-on: ubuntu-latest
90+
# only run if changes were pushed to master
91+
if: github.ref == 'refs/heads/master'
92+
steps:
93+
- name: Trigger Atomate2 CI
94+
env:
95+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
run: |
97+
curl -L \
98+
-X POST \
99+
-H "Accept: application/vnd.github+json" \
100+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
101+
-H "X-GitHub-Api-Version: 2022-11-28" \
102+
https://api.github.com/repos/materialsproject/atomate2/dispatches \
103+
-d '{"event_type": "pymatgen-ci-trigger", "client_payload": {"pymatgen_ref": "${{ github.sha }}"}}'

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ci:
88

99
repos:
1010
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: v0.4.2
11+
rev: v0.4.3
1212
hooks:
1313
- id: ruff
1414
args: [--fix, --unsafe-fixes]
@@ -47,7 +47,7 @@ repos:
4747
- id: blacken-docs
4848

4949
- repo: https://github.com/igorshubovych/markdownlint-cli
50-
rev: v0.39.0
50+
rev: v0.40.0
5151
hooks:
5252
- id: markdownlint
5353
# MD013: line too long
@@ -64,6 +64,6 @@ repos:
6464
args: [--drop-empty-cells, --keep-output]
6565

6666
- repo: https://github.com/RobertCraigie/pyright-python
67-
rev: v1.1.360
67+
rev: v1.1.361
6868
hooks:
6969
- id: pyright

dev_scripts/chemenv/strategies/multi_weights_strategy_parameters.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@
3737
__date__ = "Feb 20, 2016"
3838

3939

40-
allcg = AllCoordinationGeometries()
40+
all_cg = AllCoordinationGeometries()
4141

4242

4343
class CoordinationEnvironmentMorphing:
44-
"""Class to morph a coordination environment into another one."""
44+
"""Morph a coordination environment into another one."""
4545

4646
def __init__(self, initial_environment_symbol, expected_final_environment_symbol, morphing_description):
4747
self.initial_environment_symbol = initial_environment_symbol
4848
self.expected_final_environment_symbol = expected_final_environment_symbol
4949
self.morphing_description = morphing_description
50-
self.coordination_geometry = allcg.get_geometry_from_mp_symbol(initial_environment_symbol)
50+
self.coordination_geometry = all_cg.get_geometry_from_mp_symbol(initial_environment_symbol)
5151
self.abstract_geometry = AbstractGeometry.from_cg(self.coordination_geometry)
5252

5353
@classmethod

dev_scripts/potcar_scrambler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self, potcars: Potcar | PotcarSingle) -> None:
4747

4848
def _rand_float_from_str_with_prec(self, input_str: str, bloat: float = 1.5) -> float:
4949
n_prec = len(input_str.split(".")[1])
50-
bd = max(1, bloat * abs(float(input_str)))
50+
bd = max(1, bloat * abs(float(input_str))) # ensure we don't get 0
5151
return round(bd * np.random.rand(1)[0], n_prec)
5252

5353
def _read_fortran_str_and_scramble(self, input_str: str, bloat: float = 1.5):
@@ -172,7 +172,7 @@ def generate_fake_potcar_libraries() -> None:
172172

173173

174174
def potcar_cleanser() -> None:
175-
"""Function to replace copyrighted POTCARs used in io.vasp.sets testing
175+
"""Replace copyrighted POTCARs used in io.vasp.sets testing
176176
with dummy POTCARs that have scrambled PSP and kinetic energy values
177177
(but retain the original header information which is also found in OUTCARs
178178
and freely shared by VASP)

dev_scripts/regen_libxcfunc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ def main():
111111
del lines[start + 1 : stop]
112112

113113
# [2] write new py module
114-
with open(xc_funcpy_path, mode="w") as file:
114+
with open(xc_funcpy_path, mode="w", encoding="utf-8") as file:
115115
file.writelines(lines)
116116

117117
print("Files have been regenerated")
118-
print("Remember to update libxc_version in libxcfuncs.py!")
118+
print("Remember to update __version__ in libxcfuncs.py!")
119119

120120
return 0
121121

dev_scripts/update_pt_data.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
"""
2-
Developer script to convert yaml periodic table to json format.
3-
Created on Nov 15, 2011.
4-
"""
1+
"""Developer script to convert YAML periodic table to JSON format.
2+
Created on 2011-11-15."""
53

64
from __future__ import annotations
75

@@ -11,12 +9,17 @@
119
from itertools import product
1210

1311
import requests
14-
from bs4 import BeautifulSoup
12+
from monty.dev import requires
1513
from monty.serialization import dumpfn, loadfn
1614
from ruamel import yaml
1715

1816
from pymatgen.core import Element, get_el_sp
1917

18+
try:
19+
from bs4 import BeautifulSoup
20+
except ImportError:
21+
BeautifulSoup = None
22+
2023
ptable_yaml_path = "periodic_table.yaml"
2124

2225

@@ -74,10 +77,9 @@ def parse_ionic_radii():
7477
el = tokens[2]
7578

7679
ionic_radii = {}
77-
for j in range(3, len(tokens)):
78-
match = re.match(r"^\s*([0-9\.]+)", tokens[j])
79-
if match:
80-
ionic_radii[int(header[j])] = float(match.group(1))
80+
for tok_idx in range(3, len(tokens)):
81+
if match := re.match(r"^\s*([0-9\.]+)", tokens[tok_idx]):
82+
ionic_radii[int(header[tok_idx])] = float(match.group(1))
8183

8284
if el in data:
8385
data[el]["Ionic_radii" + suffix] = ionic_radii
@@ -231,6 +233,7 @@ def gen_iupac_ordering():
231233
periodic_table[el]["IUPAC ordering"] = iupac_ordering_dict[get_el_sp(el)]
232234

233235

236+
@requires(BeautifulSoup, "BeautifulSoup must be installed to use this method.")
234237
def add_electron_affinities():
235238
"""Update the periodic table data file with electron affinities."""
236239

docs/CHANGES.md

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/_config.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.md

Lines changed: 14 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/pymatgen.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
All examples are housed at [matgenb]. Please consult this resource first.
2+
3+
If there are questions that cannot be found in the examples, you may use the [pymatgen MatSci forum] or [GitHub discussion].
4+
5+
[matgenb]: https://matgenb.materialsvirtuallab.org/
6+
[pymatgen MatSci forum]: https://matsci.org/pymatgen
7+
[github discussion]: https://github.com/materialsproject/pymatgen/discussions

0 commit comments

Comments
 (0)