Skip to content

Commit e64a548

Browse files
authored
Move two tests to use dials-data (cctbx#810)
* Use test files for dials/dials#190 that have been moved to dials-data
1 parent 1d88582 commit e64a548

3 files changed

Lines changed: 9 additions & 13 deletions

File tree

newsfragments/810.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Convert a test to use data from ``dials-data`` rather than ``dials_regression``

tests/test_FormatCBFFull.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
from __future__ import annotations
22

3-
import os
4-
53
from libtbx.test_utils import approx_equal
64

75
from dxtbx.imageset import ImageSetFactory
86

97

10-
def test_multi_axis_goniometer(dials_regression):
11-
data_dir = os.path.join(dials_regression, "image_examples", "dials-190")
8+
def test_multi_axis_goniometer(dials_data):
9+
data_dir = dials_data("misc_regression", pathlib=True)
1210

13-
imgset = ImageSetFactory.new(os.path.join(data_dir, "whatev1_01_00001.cbf"))[0]
11+
imgset = ImageSetFactory.new(str(data_dir / "dials-190_01_00001.cbf"))[0]
1412
gonio = imgset.get_goniometer(0)
1513
assert approx_equal(gonio.get_fixed_rotation(), (1, 0, 0, 0, 1, 0, 0, 0, 1))
1614
assert approx_equal(gonio.get_setting_rotation(), (1, 0, 0, 0, 1, 0, 0, 0, 1))
1715

18-
imgset = ImageSetFactory.new(os.path.join(data_dir, "whatev1_02_00001.cbf"))[0]
16+
imgset = ImageSetFactory.new(str(data_dir / "dials-190_02_00001.cbf"))[0]
1917
gonio = imgset.get_goniometer(0)
2018
assert approx_equal(gonio.get_fixed_rotation(), (1, 0, 0, 0, 1, 0, 0, 0, 1))
2119
assert approx_equal(
@@ -24,7 +22,7 @@ def test_multi_axis_goniometer(dials_regression):
2422
eps=1e-4,
2523
)
2624

27-
imgset = ImageSetFactory.new(os.path.join(data_dir, "whatev1_03_00001.cbf"))[0]
25+
imgset = ImageSetFactory.new(str(data_dir / "dials-190_03_00001.cbf"))[0]
2826
gonio = imgset.get_goniometer(0)
2927
assert approx_equal(gonio.get_fixed_rotation(), (1, 0, 0, 0, 1, 0, 0, 0, 1))
3028
assert approx_equal(

tests/test_image_readers.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from __future__ import annotations
22

3-
import os
4-
53
import pycbf
64

75
from dxtbx.model.detector import DetectorFactory
@@ -16,10 +14,9 @@ def cbf_read_buffer(handle, contents, flags):
1614
return handle.read_buffer(contents, flags)
1715

1816

19-
def test_cbf_buffer(dials_regression):
20-
filename = os.path.join(
21-
dials_regression, "image_examples", "dials-190", "whatev1_01_00001.cbf"
22-
)
17+
def test_cbf_buffer(dials_data):
18+
data_dir = dials_data("misc_regression", pathlib=True)
19+
filename = str(data_dir / "dials-190_01_00001.cbf")
2320
with open(filename, "rb") as f:
2421
contents = f.read()
2522

0 commit comments

Comments
 (0)