Skip to content

Commit 0cf0c30

Browse files
committed
test: nonfinite values are filtered from ORSO
1 parent b078062 commit 0cf0c30

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/amor/pipeline_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,19 @@ def test_run_data_pipeline(amor_pipeline: sciline.Pipeline):
6969
@pytest.mark.filterwarnings("ignore:Invalid transformation, missing attribute")
7070
def test_run_full_pipeline(amor_pipeline: sciline.Pipeline):
7171
amor_pipeline[SampleRotation[SampleRun]] = sc.scalar(0.85, unit="deg")
72+
# Make the Q range cover a larger interval than the experiment is sensitive to.
73+
# This let's us test the non-covered regions are filtered from the ORSO data.
74+
amor_pipeline[QBins] = sc.geomspace(
75+
dim="Q", start=0.005, stop=0.15, num=391, unit="1/angstrom"
76+
)
7277
amor_pipeline[Filename[SampleRun]] = amor.data.amor_sample_run(608)
7378
res = amor_pipeline.compute(orso.OrsoIofQDataset)
7479
assert res.info.data_source.experiment.instrument == "Amor"
7580
assert res.info.reduction.software.name == "ess.reflectometry"
7681
assert res.data.ndim == 2
7782
assert res.data.shape[1] == 4
7883
assert np.all(res.data[:, 1] >= 0)
84+
assert np.isfinite(res.data).all()
7985

8086

8187
@pytest.mark.filterwarnings("ignore:Failed to convert .* into a transformation")

0 commit comments

Comments
 (0)