Keep gap pixels on RawFile only
Build on RHEL9 / build (push) Successful in 2m57s
Build on RHEL8 / build (push) Successful in 3m41s
Run tests using data on local RHEL8 / build (push) Successful in 4m44s

Drop FileConfig::gap_pixels and the File constructor argument. The
generic File does not know the detector geometry of .npy and .dat
files, so gap pixels stay a RawFile option; apply insert_gap_pixels to
frames from File when needed.
This commit is contained in:
Erik Fröjdh committed 2026-10-15 12:21:39 +02:00
1 parent 7e91a5e1af
commit b0de46e184
9 files changed
+29 -76

No files matched your search

+5 -8
View File
@@ -544,16 +544,15 @@ def test_raw_file_gap_pixels(tmp_path, layout):
with RawFile(master_path, gap_pixels=True) as reader:
assert reader.gap_pixels == GapPixels()
assert (reader.rows(), reader.cols()) == insert_gap_pixels(expected).shape
_, image = reader.read_frame()
assert (image == insert_gap_pixels(expected)).all()
with File(master_path, gap_pixels=True) as reader:
assert (reader.rows, reader.cols) == insert_gap_pixels(expected).shape
assert (reader.read_frame() == insert_gap_pixels(expected)).all()
module_gaps = GapPixels(module_gaps=ModuleGaps(8, 36))
with File(master_path, gap_pixels=module_gaps) as reader:
assert (reader.read_frame() == insert_gap_pixels(expected, module_gaps)).all()
with RawFile(master_path, gap_pixels=module_gaps) as reader:
assert (reader.rows(), reader.cols()) == insert_gap_pixels(expected, module_gaps).shape
_, image = reader.read_frame()
assert (image == insert_gap_pixels(expected, module_gaps)).all()
def test_raw_file_gap_pixels_split_counts(tmp_path):
@@ -570,8 +569,6 @@ def test_raw_file_gap_pixels_unsupported_detector(tmp_path):
RawFile(master_path)
with pytest.raises(ValueError):
RawFile(master_path, gap_pixels=True)
with pytest.raises(ValueError):
File(master_path, gap_pixels=True)
@pytest.mark.withdata