Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new uv package manager to install deps in CI #133

Merged
merged 10 commits into from
Mar 5, 2024
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions chgnet/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion chgnet/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions site/make_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading