Skip to content

Commit 1713110

Browse files
shapely fix + license (#12)
* shapely update: exterior --> boundary * add license * precommit * bump shapely * undo version downgrade * just return hull coords * lint * mypy and numpy types * add missing black dependence * and add missing pydocstyle... * reroll dependency --------- Co-authored-by: Patrick Huck <[email protected]>
1 parent b3d4243 commit 1713110

File tree

9 files changed

+204
-205
lines changed

9 files changed

+204
-205
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
pip install -e .
3131
- name: pytest
3232
run: |
33-
pytest --cov=pymatgen.analysis.diffusion --durations=30 pymatgen
33+
pytest --cov=pymatgen.analysis.alloys --durations=30 pymatgen

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2025 The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy).
2+
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6+
7+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8+
9+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10+
11+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
"""
2-
This module defines classes useful for representation of alloy systems and is
1+
"""This module defines classes useful for representation of alloy systems and is
32
intended for semiconductor alloys specifically.
43
"""

pymatgen/analysis/alloys/core.py

Lines changed: 142 additions & 191 deletions
Large diffs are not rendered by default.

pymatgen/analysis/alloys/rgb.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# You can find this script at https://github.com/rsmith-nl/wavelength_to_rgb
66
# The algorithm is based on Dan Bruton's work in
77
# http://www.physics.sfasu.edu/astro/color/spectra.html
8+
from __future__ import annotations
89

910
import base64
1011
import zlib
@@ -29,10 +30,10 @@
2930

3031

3132
def rgb(nm) -> tuple[int, int, int]:
32-
"""
33-
Converts a wavelength between 380 and 780 nm to an RGB color tuple.
33+
"""Converts a wavelength between 380 and 780 nm to an RGB color tuple.
3434
Argument:
3535
nm: Wavelength in nanometers. It is rounded to the nearest integer.
36+
3637
Returns:
3738
a 3-tuple (red, green, blue) of integers in the range 0-255.
3839
"""

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ test = [
3131
"pytest-mock",
3232
"pytest-xdist",
3333
"flake8",
34+
"black",
3435
"pycodestyle",
36+
"pydocstyle",
3537
"mypy",
3638
"mypy-extensions",
3739
"typing-extensions",
@@ -56,8 +58,7 @@ xfail_strict = true
5658
filterwarnings = ["default"]
5759
testpaths = ["pymatgen/analysis/alloys/tests"]
5860

59-
[tool.ruff]
60-
target-version = "py38"
61+
[tool.ruff.lint]
6162
select = [
6263
"B", # flake8-bugbear
6364
"D", # pydocstyle
@@ -95,7 +96,7 @@ pydocstyle.convention = "google"
9596
flake8-unused-arguments.ignore-variadic-names = true
9697
isort.required-imports = ["from __future__ import annotations"]
9798

98-
[tool.ruff.per-file-ignores]
99+
[tool.ruff.lint.per-file-ignores]
99100
"*/__init__.py" = ["F401"] # F401: imported but unused
100101

101102
[tool.black]

requirements/requirements-ubuntu-latest_py3.11_extras.txt

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ babel==2.17.0
1010
# via sphinx
1111
bibtexparser==1.4.3
1212
# via pymatgen
13+
black==25.9.0
14+
# via pymatgen-analysis-alloys (pyproject.toml)
1315
certifi==2025.10.5
1416
# via requests
1517
cfgv==3.4.0
1618
# via pre-commit
1719
charset-normalizer==3.4.4
1820
# via requests
21+
click==8.3.0
22+
# via black
1923
contourpy==1.3.3
2024
# via matplotlib
2125
coverage[toml]==7.11.0
@@ -62,6 +66,7 @@ mypy==1.18.2
6266
# via pymatgen-analysis-alloys (pyproject.toml)
6367
mypy-extensions==1.1.0
6468
# via
69+
# black
6570
# mypy
6671
# pymatgen-analysis-alloys (pyproject.toml)
6772
narwhals==2.10.1
@@ -84,6 +89,7 @@ orjson==3.11.4
8489
# via pymatgen
8590
packaging==25.0
8691
# via
92+
# black
8793
# matplotlib
8894
# plotly
8995
# pytest
@@ -93,11 +99,15 @@ palettable==3.3.3
9399
pandas==2.3.3
94100
# via pymatgen
95101
pathspec==0.12.1
96-
# via mypy
102+
# via
103+
# black
104+
# mypy
97105
pillow==12.0.0
98106
# via matplotlib
99107
platformdirs==4.5.0
100-
# via virtualenv
108+
# via
109+
# black
110+
# virtualenv
101111
plotly==6.3.1
102112
# via pymatgen
103113
pluggy==1.6.0
@@ -110,6 +120,8 @@ pycodestyle==2.14.0
110120
# via
111121
# flake8
112122
# pymatgen-analysis-alloys (pyproject.toml)
123+
pydocstyle==6.3.0
124+
# via pymatgen-analysis-alloys (pyproject.toml)
113125
pyflakes==3.4.0
114126
# via flake8
115127
pygments==2.19.2
@@ -141,6 +153,8 @@ python-dateutil==2.9.0.post0
141153
# via
142154
# matplotlib
143155
# pandas
156+
pytokens==0.2.0
157+
# via black
144158
pytz==2025.2
145159
# via pandas
146160
pyyaml==6.0.3
@@ -164,7 +178,9 @@ shapely==2.1.2
164178
six==1.17.0
165179
# via python-dateutil
166180
snowballstemmer==3.0.1
167-
# via sphinx
181+
# via
182+
# pydocstyle
183+
# sphinx
168184
spglib==2.6.0
169185
# via pymatgen
170186
sphinx==8.2.3

requirements/requirements-ubuntu-latest_py3.12_extras.txt

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ babel==2.17.0
1010
# via sphinx
1111
bibtexparser==1.4.3
1212
# via pymatgen
13+
black==25.9.0
14+
# via pymatgen-analysis-alloys (pyproject.toml)
1315
certifi==2025.10.5
1416
# via requests
1517
cfgv==3.4.0
1618
# via pre-commit
1719
charset-normalizer==3.4.4
1820
# via requests
21+
click==8.3.0
22+
# via black
1923
contourpy==1.3.3
2024
# via matplotlib
2125
coverage[toml]==7.11.0
@@ -62,6 +66,7 @@ mypy==1.18.2
6266
# via pymatgen-analysis-alloys (pyproject.toml)
6367
mypy-extensions==1.1.0
6468
# via
69+
# black
6570
# mypy
6671
# pymatgen-analysis-alloys (pyproject.toml)
6772
narwhals==2.10.1
@@ -84,6 +89,7 @@ orjson==3.11.4
8489
# via pymatgen
8590
packaging==25.0
8691
# via
92+
# black
8793
# matplotlib
8894
# plotly
8995
# pytest
@@ -93,11 +99,15 @@ palettable==3.3.3
9399
pandas==2.3.3
94100
# via pymatgen
95101
pathspec==0.12.1
96-
# via mypy
102+
# via
103+
# black
104+
# mypy
97105
pillow==12.0.0
98106
# via matplotlib
99107
platformdirs==4.5.0
100-
# via virtualenv
108+
# via
109+
# black
110+
# virtualenv
101111
plotly==6.3.1
102112
# via pymatgen
103113
pluggy==1.6.0
@@ -110,6 +120,8 @@ pycodestyle==2.14.0
110120
# via
111121
# flake8
112122
# pymatgen-analysis-alloys (pyproject.toml)
123+
pydocstyle==6.3.0
124+
# via pymatgen-analysis-alloys (pyproject.toml)
113125
pyflakes==3.4.0
114126
# via flake8
115127
pygments==2.19.2
@@ -141,6 +153,8 @@ python-dateutil==2.9.0.post0
141153
# via
142154
# matplotlib
143155
# pandas
156+
pytokens==0.2.0
157+
# via black
144158
pytz==2025.2
145159
# via pandas
146160
pyyaml==6.0.3
@@ -164,7 +178,9 @@ shapely==2.1.2
164178
six==1.17.0
165179
# via python-dateutil
166180
snowballstemmer==3.0.1
167-
# via sphinx
181+
# via
182+
# pydocstyle
183+
# sphinx
168184
spglib==2.6.0
169185
# via pymatgen
170186
sphinx==8.2.3

requirements/ubuntu-latest_py3.11.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
bibtexparser==1.4.3
1111
# via pymatgen
12+
black==25.9.0
13+
pydocstyle==6.3.0
1214
certifi==2025.10.5
1315
# via requests
1416
charset-normalizer==3.4.4

0 commit comments

Comments
 (0)