File tree Expand file tree Collapse file tree 5 files changed +45
-2
lines changed Expand file tree Collapse file tree 5 files changed +45
-2
lines changed Original file line number Diff line number Diff line change 31
31
os-variant : ${{ matrix.os }}
32
32
python-version : ${{ matrix.python.version }}
33
33
tox-env : ${{ matrix.python.tox-env }}
34
+ test-artifacts-name : ' essreflectometry-test-artifacts-latest'
34
35
secrets : inherit
Original file line number Diff line number Diff line change 38
38
python-version : ${{ matrix.python.version }}
39
39
tox-env : ${{ matrix.python.tox-env }}
40
40
checkout_ref : ${{ needs.setup.outputs.release_tag }}
41
+ test-artifacts-name : ' essreflectometry-test-artifacts-stable'
41
42
secrets : inherit
Original file line number Diff line number Diff line change 20
20
checkout_ref :
21
21
default : ' '
22
22
type : string
23
+ test-artifacts-name :
24
+ default : ' '
25
+ type : string
23
26
workflow_call :
24
27
inputs :
25
28
os-variant :
39
42
checkout_ref :
40
43
default : ' '
41
44
type : string
45
+ test-artifacts-name :
46
+ default : ' '
47
+ type : string
42
48
43
49
jobs :
44
50
package-test :
71
77
python-version : ${{ inputs.python-version }}
72
78
- run : python -m pip install --upgrade pip
73
79
- run : python -m pip install -r ${{ inputs.pip-recipe }}
74
- - run : tox -e ${{ inputs.tox-env }}
80
+ - run : tox -e ${{ inputs.tox-env }} -- --file-output="tests_outputs"
75
81
- uses : actions/upload-artifact@v4
76
82
if : ${{ inputs.coverage-report }}
77
83
with :
78
84
name : CoverageReport
79
85
path : coverage_html/
86
+ - uses : actions/upload-artifact@v4
87
+ if : ${{ inputs.test-artifacts-name != '' }}
88
+ with :
89
+ name : ${{ inputs.test-artifacts-name }}
90
+ path : tests_outputs/
Original file line number Diff line number Diff line change 1
1
# SPDX-License-Identifier: BSD-3-Clause
2
2
# Copyright (c) 2024 Scipp contributors (https://github.com/scipp)
3
- # flake8: noqa: F403, F405
3
+ from pathlib import Path
4
4
5
5
import numpy as np
6
6
import pytest
@@ -91,6 +91,17 @@ def test_orso_pipeline(amor_pipeline: sciline.Pipeline):
91
91
assert np .isfinite (res .data ).all ()
92
92
93
93
94
+ @pytest .mark .filterwarnings ("ignore:Failed to convert .* into a transformation" )
95
+ @pytest .mark .filterwarnings ("ignore:Invalid transformation, missing attribute" )
96
+ def test_save_reduced_orso_file (amor_pipeline : sciline .Pipeline , output_folder : Path ):
97
+ from orsopy import fileio
98
+
99
+ amor_pipeline [SampleRotation [SampleRun ]] = sc .scalar (0.85 , unit = "deg" )
100
+ amor_pipeline [Filename [SampleRun ]] = amor .data .amor_sample_run (608 )
101
+ res = amor_pipeline .compute (orso .OrsoIofQDataset )
102
+ fileio .orso .save_orso (datasets = [res ], fname = output_folder / 'amor_reduced_iofq.ort' )
103
+
104
+
94
105
@pytest .mark .filterwarnings ("ignore:Failed to convert .* into a transformation" )
95
106
@pytest .mark .filterwarnings ("ignore:Invalid transformation, missing attribute" )
96
107
def test_pipeline_can_compute_reflectivity_merging_events_from_multiple_runs (
Original file line number Diff line number Diff line change
1
+ # SPDX-License-Identifier: BSD-3-Clause
2
+ # Copyright (c) 2025 Scipp contributors (https://github.com/scipp)
3
+
4
+ from pathlib import Path
5
+
6
+ import pytest
7
+
8
+
9
+ def pytest_addoption (parser : pytest .Parser ) -> None :
10
+ parser .addoption ("--file-output" , help = 'Output folder for reduced data' )
11
+
12
+
13
+ @pytest .fixture
14
+ def output_folder (request : pytest .FixtureRequest ) -> Path :
15
+ if (path := request .config .getoption ("--file-output" )) is not None :
16
+ out = Path (path )
17
+ out .mkdir (parents = True , exist_ok = True )
18
+ return out
19
+ return request .getfixturevalue ("tmp_path" )
You can’t perform that action at this time.
0 commit comments