Skip to content

Commit

Permalink
TST: Integrate enumerations in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwboth committed Aug 21, 2024
1 parent 3713424 commit 2ac63f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tests/unit/test_variational_wasserstein_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

options = {
# Method definition
"l1_mode": "raviart_thomas",
"l1_mode": darsia.L1Mode.RAVIART_THOMAS,
}

grid = darsia.generate_grid(dst_image_2d)
Expand All @@ -40,7 +40,7 @@
def test_vector_face_flux_norm_cell_based():
"""Compare with the manually determined exact cell based face mobility."""
# NOTE the coarse tolerance due to such large quadrature error
options.update({"mobility_mode": "cell_based"})
options.update({"mobility_mode": darsia.MobilityMode.CELL_BASED})
w1 = darsia.VariationalWassersteinDistance(grid, options=options)
_, face_weight_inv = w1._compute_face_weight(flat_flux)
# Identify flux norm as face weight inv
Expand All @@ -49,7 +49,7 @@ def test_vector_face_flux_norm_cell_based():

def test_vector_face_flux_norm_subcell_based():
"""Compare with the manually determined exact subcell based face mobility."""
options.update({"mobility_mode": "subcell_based"})
options.update({"mobility_mode": darsia.MobilityMode.SUBCELL_BASED})
w1 = darsia.VariationalWassersteinDistance(grid, options=options)
_, face_weight_inv = w1._compute_face_weight(flat_flux)
# Identify flux norm as face weight inv
Expand All @@ -61,7 +61,7 @@ def test_vector_face_flux_norm_subcell_based():

def test_vector_face_flux_norm_face_based():
"""Compare with the manually determined exact face based face mobility."""
options.update({"mobility_mode": "face_based"})
options.update({"mobility_mode": darsia.MobilityMode.FACE_BASED})
w1 = darsia.VariationalWassersteinDistance(grid, options=options)
_, face_weight_inv = w1._compute_face_weight(flat_flux)
# Identify flux norm as face weight inv
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_wasserstein.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@
# General options
options = {
# Method definition
"l1_mode": "constant_cell_projection",
"mobility_mode": "face_based",
"l1_mode": darsia.L1Mode.CONSTANT_CELL_PROJECTION,
"mobility_mode": darsia.MobilityMode.FACE_BASED,
# Performance control
"num_iter": 400,
"tol_residual": 1e-10,
Expand Down

0 comments on commit 2ac63f0

Please sign in to comment.