Skip to content

Commit eee56ac

Browse files
committed
Fix get_peak2d_data calls to include seed parameter for consistent test data
1 parent 1da7e03 commit eee56ac

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

cdl/tests/sigima_tests/images/peak2d_unit_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def view_image_peak_detection(data: np.ndarray, coords: np.ndarray) -> None:
6161

6262
def test_peak2d_unit():
6363
"""2D peak detection unit test"""
64-
data, coords_expected = get_peak2d_data(multi=False)
64+
data, coords_expected = get_peak2d_data(seed=1, multi=False)
6565
coords = exec_image_peak_detection_func(data)
6666
assert coords.shape == coords_expected.shape, (
6767
f"Expected {coords_expected.shape[0]} peaks, got {coords.shape[0]}"
@@ -74,7 +74,7 @@ def test_peak2d_unit():
7474
@pytest.mark.validation
7575
def test_image_peak_detection():
7676
"""2D peak detection unit test"""
77-
data, coords_expected = get_peak2d_data(multi=False)
77+
data, coords_expected = get_peak2d_data(seed=1, multi=False)
7878
obj = sigima_.obj.create_image("peak2d_unit_test", data=data)
7979
param = sigima_.param.Peak2DDetectionParam()
8080
df = sigima_image.peak_detection(obj, param).to_dataframe()

sigima_/tests/data.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,7 @@ def get_peak2d_data(
325325
Args:
326326
p: Peak data test image parameters. Defaults to None.
327327
seed: Seed for random number generator. Defaults to None.
328-
multi: If True, multiple peaks are generated.
329-
Defaults to False.
328+
multi: If True, multiple peaks are generated. Defaults to False.
330329
331330
Returns:
332331
A tuple containing the image data and coordinates of the peaks.

0 commit comments

Comments
 (0)