Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and mtsokol committed Mar 13, 2024
1 parent 868544d commit 29c99b2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
environment-file: ci/environment.yml
python-version: ${{ matrix.python }}
miniforge-version: latest
- uses: julia-actions/setup-julia@v1.9
with:
version: '1.10'
- name: Install package
run: |
pip install -e .[tests,finch]
Expand Down
6 changes: 3 additions & 3 deletions sparse/finch_backend/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
try:
import finch
import finch # noqa: F401
except ModuleNotFoundError:
raise ImportError("Finch not installed. Run `pip install sparse[finch]` to enable Finch backend")
raise ImportError("Finch not installed. Run `pip install sparse[finch]` to enable Finch backend") from None

from finch import Tensor, permute_dims, astype
from finch import Tensor, astype, permute_dims

__all__ = ["Tensor", "permute_dims", "astype"]

Expand Down
9 changes: 9 additions & 0 deletions sparse/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import sparse

import pytest


@pytest.fixture(scope="session", params=[sparse.BackendType.PyData, sparse.BackendType.Finch])
def backend(request):
with sparse.Backend(backend=request.param):
yield request.param
5 changes: 2 additions & 3 deletions sparse/tests/test_backends.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import sparse
import scipy.sparse as sp
import numpy as np

import pytest

import numpy as np
import scipy.sparse as sp


def test_backend_contex_manager(backend):
Expand All @@ -19,7 +19,6 @@ def test_finch_backend():
sp_arr = sp.csr_matrix(np_eye)

with sparse.Backend(backend=sparse.BackendType.finch):

finch_dense = sparse.Tensor(np_eye)

assert np.shares_memory(finch_dense.todense(), np_eye)
Expand Down

0 comments on commit 29c99b2

Please sign in to comment.