diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc88f08..89681f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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}} @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 7604a42..6ab8b80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = "anthony.onwuli16@imperial.ac.uk" } +] +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 diff --git a/setup.py b/setup.py deleted file mode 100644 index da188af..0000000 --- a/setup.py +++ /dev/null @@ -1,82 +0,0 @@ -"""Setup script for AtomicEmbeddings.""" - -from __future__ import annotations - -import os - -from setuptools import find_namespace_packages, setup - -module_dir = os.path.dirname(os.path.abspath(__file__)) - -VERSION = "0.6.1" -DESCRIPTION = "Element Embeddings" -with open(os.path.join(module_dir, "README.md"), encoding="utf-8") as f: - LONG_DESCRIPTION = f.read() - - -# Setting up -setup( - name="ElementEmbeddings", - version=VERSION, - author="Anthony O. Onwuli", - author_email="anthony.onwuli16@imperial.ac.uk", - description=DESCRIPTION, - long_description=LONG_DESCRIPTION, - long_description_content_type="text/markdown", - packages=find_namespace_packages(where="src"), - package_dir={"": "src"}, - package_data={ - "elementembeddings.data.element_representations": ["*.json", "*.csv"], - "elementembeddings.data.element_data": ["*.json", "*.txt"], - "elementembeddings.data.species_representations": ["*.json", "*.csv"], - }, - test_suite="elementembeddings.tests.test", - install_requires=[ - "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", - ], - extras_require={ - "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", - ], - }, - classifiers=[ - "Programming Language :: Python", - "Programming Language :: Python :: 3.9", - "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", - ], -) diff --git a/src/elementembeddings/_base.py b/src/elementembeddings/_base.py index b65c3da..6b74712 100644 --- a/src/elementembeddings/_base.py +++ b/src/elementembeddings/_base.py @@ -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 diff --git a/src/elementembeddings/core.py b/src/elementembeddings/core.py index fea6a51..c665cb5 100644 --- a/src/elementembeddings/core.py +++ b/src/elementembeddings/core.py @@ -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: diff --git a/src/elementembeddings/plotter.py b/src/elementembeddings/plotter.py index dc74adf..a242325 100644 --- a/src/elementembeddings/plotter.py +++ b/src/elementembeddings/plotter.py @@ -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))]