Skip to content

Commit 1e9e311

Browse files
committed
Parameterize SNAPHU unit tests on init method
1 parent fba48cf commit 1e9e311

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/python/packages/isce3/unwrap/snaphu.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import isce3
44
import numpy as np
5+
import pytest
56
from isce3.unwrap import snaphu
67

78

@@ -195,7 +196,8 @@ def simulate_phase_noise(corr, nlooks: float, *, seed: Optional[int] = None):
195196

196197

197198
class TestSnaphu:
198-
def test_smooth_cost(self):
199+
@pytest.mark.parametrize("init_method", ["mcf", "mst"])
200+
def test_smooth_cost(self, init_method):
199201
"""Test SNAPHU unwrapping using "smooth" cost mode."""
200202
# Interferogram dimensions
201203
l, w = 1100, 256
@@ -249,6 +251,7 @@ def test_smooth_cost(self):
249251
corr_raster,
250252
nlooks=20.0,
251253
cost="smooth",
254+
init_method=init_method,
252255
conncomp_params=conncomp_params,
253256
)
254257

@@ -272,7 +275,8 @@ def test_smooth_cost(self):
272275
cc = ccl_raster.data == label
273276
assert jaccard_similarity(cc, mask) > 0.9
274277

275-
def test_topo_cost(self):
278+
@pytest.mark.parametrize("init_method", ["mcf", "mst"])
279+
def test_topo_cost(self, init_method):
276280
"""Test SNAPHU unwrapping using "topo" cost mode."""
277281
# Simulate a topographic interferometric phase signal using notionally
278282
# NISAR-like 20 MHz L-band parameters.
@@ -344,6 +348,7 @@ def test_topo_cost(self):
344348
nlooks=nlooks,
345349
cost="topo",
346350
cost_params=cost_params,
351+
init_method=init_method,
347352
)
348353

349354
# Check the connected component labels. There should be a single

0 commit comments

Comments
 (0)