Skip to content

Commit 6dd5f72

Browse files
Merge branch 'dev' into lf-dev
2 parents e261f94 + e1e26ce commit 6dd5f72

File tree

2 files changed

+52
-12
lines changed

2 files changed

+52
-12
lines changed

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
project = 'Pyvale'
1919
copyright = '2025, The CAV Team'
2020
author = 'The CAV Team at United Kingdom Atomic Energy Authority (UKAEA)'
21-
release = '2025.7.2'
22-
version = '2025.7.2'
21+
release = '2025.8.1'
22+
version = '2025.8.1'
2323

2424
# -- General configuration ---------------------------------------------------
2525
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

tests/dic/test_dic.py

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import os
1111
os.environ['OMP_NUM_THREADS'] = '1'
1212

13+
import numpy as np
1314
import pyvale.dic as dic
1415

1516
test_dir = os.path.dirname(__file__)
@@ -39,8 +40,15 @@ def test_image_scan_znssd_affine():
3940
test_file = os.path.abspath(os.path.join(test_dir, "./test_image_scan_znssd_affine_plate_rigid_def0000.csv"))
4041

4142

42-
with open(ref_file) as f1, open(test_file) as f2:
43-
assert list(f1) == list(f2)
43+
ref = np.loadtxt(ref_file, skiprows=1, delimiter=',')
44+
test = np.loadtxt(test_file, skiprows=1, delimiter=',')
45+
46+
np.testing.assert_allclose(
47+
ref[:, :7],
48+
test[:, :7],
49+
rtol=1e-8, atol=1e-6,
50+
err_msg="First 7 columns of reference and test CSVs do not match."
51+
)
4452

4553
os.remove(test_file)
4654

@@ -63,8 +71,15 @@ def test_image_scan_znssd_rigid():
6371
test_file = os.path.abspath(os.path.join(test_dir, "./test_image_scan_znssd_rigid_plate_rigid_def0000.csv"))
6472

6573

66-
with open(ref_file) as f1, open(test_file) as f2:
67-
assert list(f1) == list(f2)
74+
ref = np.loadtxt(ref_file, skiprows=1, delimiter=',')
75+
test = np.loadtxt(test_file, skiprows=1, delimiter=',')
76+
77+
np.testing.assert_allclose(
78+
ref[:, :7],
79+
test[:, :7],
80+
rtol=1e-8, atol=1e-6,
81+
err_msg="First 7 columns of reference and test CSVs do not match."
82+
)
6883

6984
os.remove(test_file)
7085

@@ -87,8 +102,15 @@ def test_image_scan_nssd_affine():
87102
test_file = os.path.abspath(os.path.join(test_dir, "./test_image_scan_nssd_affine_plate_rigid_def0000.csv"))
88103

89104

90-
with open(ref_file) as f1, open(test_file) as f2:
91-
assert list(f1) == list(f2)
105+
ref = np.loadtxt(ref_file, skiprows=1, delimiter=',')
106+
test = np.loadtxt(test_file, skiprows=1, delimiter=',')
107+
108+
np.testing.assert_allclose(
109+
ref[:, :7],
110+
test[:, :7],
111+
rtol=1e-8, atol=1e-6,
112+
err_msg="First 7 columns of reference and test CSVs do not match."
113+
)
92114

93115
os.remove(test_file)
94116

@@ -110,9 +132,20 @@ def test_rg_znssd_affine():
110132
ref_file = os.path.abspath(os.path.join(test_dir, "./reference/ref_rg_znssd_affine_plate_rigid.csv"))
111133
test_file = os.path.abspath(os.path.join(test_dir, "./test_rg_znssd_affine_plate_rigid_def0000.csv"))
112134

135+
ref = np.loadtxt(ref_file, skiprows=1, delimiter=',')
136+
test = np.loadtxt(test_file, skiprows=1, delimiter=',')
137+
138+
np.testing.assert_allclose(
139+
ref[:, :7],
140+
test[:, :7],
141+
rtol=1e-8, atol=1e-6,
142+
err_msg="First 7 columns of reference and test CSVs do not match."
143+
)
113144

114-
with open(ref_file) as f1, open(test_file) as f2:
115-
assert list(f1) == list(f2)
145+
146+
147+
# with open(ref_file) as f1, open(test_file) as f2:
148+
# assert list(f1) == list(f2)
116149

117150

118151
os.remove(test_file)
@@ -136,8 +169,15 @@ def test_fft_znssd_affine():
136169
test_file = os.path.abspath(os.path.join(test_dir, "./test_fft_znssd_affine_plate_rigid_def0000.csv"))
137170

138171

139-
with open(ref_file) as f1, open(test_file) as f2:
140-
assert list(f1) == list(f2)
172+
ref = np.loadtxt(ref_file, skiprows=1, delimiter=',')
173+
test = np.loadtxt(test_file, skiprows=1, delimiter=',')
174+
175+
np.testing.assert_allclose(
176+
ref[:, :7],
177+
test[:, :7],
178+
rtol=1e-8, atol=1e-6,
179+
err_msg="First 7 columns of reference and test CSVs do not match."
180+
)
141181

142182

143183
os.remove(test_file)

0 commit comments

Comments
 (0)