Skip to content

Commit e1e26ce

Browse files
committed
added small (1e-6) tolerance for DIC tests.
1 parent ad3890f commit e1e26ce

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/dic/test_dic.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ def test_image_scan_znssd_affine():
4343
ref = np.loadtxt(ref_file, skiprows=1, delimiter=',')
4444
test = np.loadtxt(test_file, skiprows=1, delimiter=',')
4545

46-
np.testing.assert_array_equal(
46+
np.testing.assert_allclose(
4747
ref[:, :7],
4848
test[:, :7],
49+
rtol=1e-8, atol=1e-6,
4950
err_msg="First 7 columns of reference and test CSVs do not match."
5051
)
5152

@@ -73,9 +74,10 @@ def test_image_scan_znssd_rigid():
7374
ref = np.loadtxt(ref_file, skiprows=1, delimiter=',')
7475
test = np.loadtxt(test_file, skiprows=1, delimiter=',')
7576

76-
np.testing.assert_array_equal(
77+
np.testing.assert_allclose(
7778
ref[:, :7],
7879
test[:, :7],
80+
rtol=1e-8, atol=1e-6,
7981
err_msg="First 7 columns of reference and test CSVs do not match."
8082
)
8183

@@ -103,9 +105,10 @@ def test_image_scan_nssd_affine():
103105
ref = np.loadtxt(ref_file, skiprows=1, delimiter=',')
104106
test = np.loadtxt(test_file, skiprows=1, delimiter=',')
105107

106-
np.testing.assert_array_equal(
108+
np.testing.assert_allclose(
107109
ref[:, :7],
108110
test[:, :7],
111+
rtol=1e-8, atol=1e-6,
109112
err_msg="First 7 columns of reference and test CSVs do not match."
110113
)
111114

@@ -132,9 +135,10 @@ def test_rg_znssd_affine():
132135
ref = np.loadtxt(ref_file, skiprows=1, delimiter=',')
133136
test = np.loadtxt(test_file, skiprows=1, delimiter=',')
134137

135-
np.testing.assert_array_equal(
138+
np.testing.assert_allclose(
136139
ref[:, :7],
137140
test[:, :7],
141+
rtol=1e-8, atol=1e-6,
138142
err_msg="First 7 columns of reference and test CSVs do not match."
139143
)
140144

@@ -168,9 +172,10 @@ def test_fft_znssd_affine():
168172
ref = np.loadtxt(ref_file, skiprows=1, delimiter=',')
169173
test = np.loadtxt(test_file, skiprows=1, delimiter=',')
170174

171-
np.testing.assert_array_equal(
175+
np.testing.assert_allclose(
172176
ref[:, :7],
173177
test[:, :7],
178+
rtol=1e-8, atol=1e-6,
174179
err_msg="First 7 columns of reference and test CSVs do not match."
175180
)
176181

0 commit comments

Comments
 (0)