Skip to content

Commit

Permalink
TST: Only test for KSP solvers if PETSc is available
Browse files Browse the repository at this point in the history
  • Loading branch information
jwboth committed Aug 29, 2024
1 parent 675ac8a commit d2d416a
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions tests/unit/test_wasserstein.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@

import darsia

try:
import petsc4py

HAVE_PETSC = True
except ImportError:
HAVE_PETSC = False

# ! ---- 2d version ----

# Coarse src image
Expand Down Expand Up @@ -148,13 +155,16 @@
}


solvers = [
lu_options,
amg_options,
ksp_direct_options,
ksp_krylov_options,
ksp_block_krylov_options,
]
solvers = (
[lu_options, amg_options]
+ [
ksp_direct_options,
ksp_krylov_options,
ksp_block_krylov_options,
]
if HAVE_PETSC
else []
)


# General options
Expand Down

0 comments on commit d2d416a

Please sign in to comment.