Skip to content

Commit

Permalink
Raise if cupy is installed but cuda isn't
Browse files Browse the repository at this point in the history
  • Loading branch information
loganbvh committed Jan 30, 2024
1 parent 3c7d3f7 commit d52ceac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tdgl/finite_volume/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

try:
import cupy # type: ignore
from cupyx.scipy.sparse import csc_matrix, csr_matrix # type: ignore
from cupyx.scipy.sparse.linalg import factorized # type: ignore
except ImportError:
cupy = None
else:
from cupyx.scipy.sparse import csc_matrix, csr_matrix # type: ignore
from cupyx.scipy.sparse.linalg import factorized # type: ignore

Check warning on line 13 in tdgl/finite_volume/operators.py

View check run for this annotation

Codecov / codecov/patch

tdgl/finite_volume/operators.py#L12-L13

Added lines #L12 - L13 were not covered by tests

from ..solver.options import SparseSolver
from .mesh import Mesh
Expand Down

0 comments on commit d52ceac

Please sign in to comment.