Skip to content

Commit

Permalink
Merge pull request #178 from WMD-group/bump_python
Browse files Browse the repository at this point in the history
Drop Python 3.9 support
  • Loading branch information
AntObi authored Jan 9, 2025
2 parents 4abe5ac + e5ada19 commit 4154323
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 92 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{matrix.os}}
Expand All @@ -30,12 +30,13 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -e ".[dev]"
python -m pip install --upgrade uv
uv pip install -e ".[dev]" --system
- name: Check package versions
run: |
pip show -V elementembeddings
pip show -V pytest
pip show -V matplotlib
uv pip show -V elementembeddings
uv pip show -V pytest
uv pip show -V matplotlib
- name: Run tests
run: python -m pytest --mpl --mpl-baseline-path=src/elementembeddings/tests/baseline --cov=src/elementembeddings --cov-report=xml -v
Expand Down
63 changes: 61 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,73 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools"] # PEP 508 specifications.
requires = ["setuptools>=65.0.0"] # PEP 508 specifications.
build-backend = "setuptools.build_meta"

[project]
name = "ElementEmbeddings"
version = "0.6.1"
description = "Element Embeddings"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "MIT" }
authors = [
{ name = "Anthony O. Onwuli", email = "[email protected]" }
]
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Chemistry",
"License :: OSI Approved :: MIT License",
]
dependencies = [
"numpy>=1.23.3,<3",
"scipy>=1.10.1",
"pymatgen>2022.9.21",
"seaborn>=0.13.0",
"matplotlib>=3.7.1",
"scikit-learn>=1.3.0",
"umap-learn>=0.5.3",
"adjustText>=0.8",
"openTSNE>=1.0.0",
"typing-extensions",
"llvmlite>=0.40",
]

[project.optional-dependencies]
dev = [
"pre-commit",
"black",
"isort",
"pytest",
"pytest-subtests",
"nbqa",
"flake8",
"pyupgrade",
"autopep8",
"pytest-cov",
"pytest-mpl",
]
docs = [
"mkdocs",
"mkdocs-material",
"mkdocstrings",
"mkdocstrings-python",
"mike",
"mkdocs-jupyter",
]

[tool.semantic_release]
version_variable = "setup.py:__version__"
version_source = "tag"

[tool.ruff]
target-version = "py39"
target-version = "py310"
line-length = 120
force-exclude = true

Expand Down
82 changes: 0 additions & 82 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/elementembeddings/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def standardise(self, inplace: bool = False):
embeddings_copy = self.embeddings.copy()
embeddings_array = np.array(list(embeddings_copy.values()))
embeddings_array = StandardScaler().fit_transform(embeddings_array)
for el, emb in zip(embeddings_copy.keys(), embeddings_array):
for el, emb in zip(embeddings_copy.keys(), embeddings_array, strict=False):
embeddings_copy[el] = emb
if inplace:
self.embeddings = embeddings_copy
Expand Down
2 changes: 1 addition & 1 deletion src/elementembeddings/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def standardise(self, inplace: bool = False):
embeddings_copy = self.embeddings.copy()
embeddings_array = np.array(list(embeddings_copy.values()))
embeddings_array = StandardScaler().fit_transform(embeddings_array)
for el, emb in zip(embeddings_copy.keys(), embeddings_array):
for el, emb in zip(embeddings_copy.keys(), embeddings_array, strict=False):
embeddings_copy[el] = emb

if inplace:
Expand Down
2 changes: 1 addition & 1 deletion src/elementembeddings/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def dimension_plotter(

species_labels = [
rf"$\mathregular{{{element}^{{{abs(charge)}{sign}}}}}$"
for (element, charge), sign in zip(parsed_species, signs)
for (element, charge), sign in zip(parsed_species, signs, strict=False)
]

texts = [ax.text(df["x"][i], df["y"][i], species_labels[i], fontsize=12) for i in range(len(df))]
Expand Down

0 comments on commit 4154323

Please sign in to comment.