diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e176e87..6c42dcac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,14 +33,17 @@ jobs: cache: pip cache-dependency-path: pyproject.toml + - name: Install uv + run: pip install uv + - name: Install dependencies run: | - pip install cython + uv pip install cython --system # install ase from main branch until FrechetCellFilter is released - # TODO remove pip install git+https://gitlab.com/ase/ase - pip install git+https://gitlab.com/ase/ase + # TODO remove uv pip install git+https://gitlab.com/ase/ase python setup.py build_ext --inplace - pip install -e .[test] + uv pip install -e .[test] --system + uv pip install --upgrade 'ase@git+https://gitlab.com/ase/ase' --system - name: Run Tests run: pytest --capture=no --cov --cov-report=xml . diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 63d189c1..60fa5e18 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ default_install_hook_types: [pre-commit, commit-msg] repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.2 + rev: v0.3.0 hooks: - id: ruff args: [--fix] @@ -46,7 +46,7 @@ repos: - svelte - repo: https://github.com/pre-commit/mirrors-eslint - rev: v9.0.0-beta.0 + rev: v9.0.0-beta.1 hooks: - id: eslint types: [file] diff --git a/chgnet/graph/graph.py b/chgnet/graph/graph.py index 089d710f..9b23ca58 100644 --- a/chgnet/graph/graph.py +++ b/chgnet/graph/graph.py @@ -186,9 +186,9 @@ def add_edge(self, center_index, neighbor_index, image, distance) -> None: # is the reverse of our DE if added_DE == this_directed_edge: # Add UDE index to this DE - this_directed_edge.info[ - "undirected_edge_index" - ] = added_DE.info["undirected_edge_index"] + this_directed_edge.info["undirected_edge_index"] = ( + added_DE.info["undirected_edge_index"] + ) # At the center node, draw edge with this DE self.nodes[center_index].add_neighbor( diff --git a/chgnet/model/model.py b/chgnet/model/model.py index f1efad7f..03d0b1db 100644 --- a/chgnet/model/model.py +++ b/chgnet/model/model.py @@ -807,7 +807,9 @@ def from_graphs( else: strain = None lattice = graph.lattice - volumes.append(torch.dot(lattice[0], torch.cross(lattice[1], lattice[2]))) + volumes.append( + torch.dot(lattice[0], torch.linalg.cross(lattice[1], lattice[2])) + ) strains.append(strain) # Bonds diff --git a/pyproject.toml b/pyproject.toml index e0d99c6f..6e40e8d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -99,6 +99,7 @@ ignore = [ "EM", "ERA001", # found commented out code "FBT001", # Boolean positional argument in function + "ISC001", "FBT002", # Boolean keyword argument in function "NPY002", # TODO replace legacy np.random.seed "PLR", # pylint refactor diff --git a/site/make_docs.py b/site/make_docs.py index 5eb811bb..de9b1d2b 100644 --- a/site/make_docs.py +++ b/site/make_docs.py @@ -3,6 +3,7 @@ - prettier badges linking to source code on GitHub - remove bold tags since they break inline code. """ + from __future__ import annotations import json