Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create actions.yml #14

Merged
merged 32 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5360f7b
Create actions.yml
mdoucet Oct 10, 2023
68d906d
Create environment.yml
mdoucet Oct 10, 2023
b0992fb
Update pyproject.toml
mdoucet Oct 10, 2023
b70dc14
Update actions.yml
mdoucet Oct 10, 2023
98faff2
Update actions.yml
mdoucet Oct 10, 2023
9b8eaf2
Update actions.yml
mdoucet Oct 10, 2023
bae80bc
Create .gitmodules
mdoucet Oct 10, 2023
0803f0a
Update test_reduction.py
mdoucet Oct 10, 2023
3a883ec
Update test_reduction.py
mdoucet Oct 10, 2023
078f957
Update test_reduction.py
mdoucet Oct 10, 2023
25bbf3e
Update test_reduction.py
mdoucet Oct 10, 2023
2121584
Update test_reduction.py
mdoucet Oct 10, 2023
e23f748
Update test_reduction.py
mdoucet Oct 10, 2023
3b1fa41
Update test_reduction.py
mdoucet Oct 10, 2023
2f13c0e
Update test_reduction.py
mdoucet Oct 10, 2023
8a9dc82
Update test_reduction.py
mdoucet Oct 10, 2023
8811e76
Update test_reduction.py
mdoucet Oct 10, 2023
1779354
Update test_reduction.py
mdoucet Oct 10, 2023
8776a68
Update test_reduction.py
mdoucet Oct 10, 2023
26c4931
Update test_reduction.py
mdoucet Oct 10, 2023
f524b02
Update test_reduction.py
mdoucet Oct 10, 2023
1e0e1b4
Update .gitmodules
mdoucet Oct 10, 2023
cc5032c
Update actions.yml
mdoucet Oct 10, 2023
8f846e9
Update test_reduction.py
mdoucet Oct 10, 2023
965211b
Update actions.yml
mdoucet Oct 10, 2023
6350446
Delete .gitmodules
mdoucet Oct 10, 2023
73061a8
Update actions.yml
mdoucet Oct 10, 2023
41a095c
add scaling factor file
mdoucet Oct 10, 2023
9454177
clean up
mdoucet Oct 10, 2023
c6df1f2
update template
mdoucet Oct 10, 2023
cc6cef2
update template
mdoucet Oct 10, 2023
54665a4
add sf file
mdoucet Oct 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on:
workflow_dispatch:
pull_request:
push:
branches:
- master

jobs:
tests:
runs-on: self-hosted
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge,defaults,mantid
auto-update-conda: true
miniforge-version: latest
python-version: "3.8"
environment-file: environment.yml
activate-environment: liquid-ref
- name: Restore cached conda environment
id: cache-load
uses: actions/cache/restore@v3
with:
path: /usr/share/miniconda/envs/liquid-ref
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
- name: Load Environment
if: steps.cache-load.outputs.cache-hit != 'true'
run: |
mamba env update --file environment.yml --prune
- name: Start xvfb daemon
run: |
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
- name: Test with pytest
working-directory: ./reduction
run: |
echo datasearch.directories=/home/cloud/_work/LiquidsReflectometer/LiquidsReflectometer/reduction/tests/data/liquidsreflectometer-data/nexus/ >> ~/.mantid/Mantid.user.properties
cat ~/.mantid/Mantid.user.properties
git submodule add --force https://code.ornl.gov/sns-hfir-scse/infrastructure/test-data/liquidsreflectometer-data.git tests/data/liquidsreflectometer-data
git submodule update --init
python -m pytest --cov=reduction --cov-report=xml --cov-report=term test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
18 changes: 18 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: liquid-ref
channels:
- conda-forge
- default
- mantid
dependencies:
- pre-commit
- pytest
- pytest-cov
- numpy
- python=3.8
- mantidworkbench>=6.7.0
- codecov
- conda-build
- python-build
- versioningit
- boa
- conda-verify
19 changes: 17 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,20 @@ ignore = ["E402", # module level import not at top of file
"F405", "F821", # unknown names from probably from wild imports
]

[tool.black]
line-length = 140
[tool.coverage.run]
branch = true

[tool.coverage.report]
skip_empty = true

[tool.pytest.ini_options]
pythonpath = [
".", "reduction", "scripts", "tests/data/liquidsreflectometer-data/nexus/"
]

testpaths = ["tests"]
norecursedirs = [".git", "tmp*", "_tmp*", "__pycache__", "*dataset*", "*data_set*"]
markers = [
"datarepo: mark a test as using LiquidsReflectometer-data repository",
"scripts: mark a test as a script that should be run manually",
]
14 changes: 14 additions & 0 deletions reduction/data/sf_197912_Si_auto.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# y=a+bx
#
# LambdaRequested[Angstroms] S1H[mm] (S2/Si)H[mm] S1W[mm] (S2/Si)W[mm] a b error_a error_b
#
# Medium=Si, runs: [197920, 197921, 197922, 197923, 197924, 197925, 197926, 197927, 197928, 197929, 197930, 197931]
IncidentMedium=Si LambdaRequested=9.74 S1H=0.391 S2iH=0.24999999999999978 S1W=20.005 S2iW=20.000084375 a=1.1051209892255538 b=-5.536686634970115e-07 error_a=0.046673303933524965 error_b=1.3017622676214164e-06
IncidentMedium=Si LambdaRequested=7.043 S1H=0.39 S2iH=0.24999999999999978 S1W=19.992000000000005 S2iW=19.990864375000002 a=6.624303827034047 b=1.9231042128909928e-05 error_a=0.23125978138549352 error_b=9.279372359246127e-06
IncidentMedium=Si LambdaRequested=4.25 S1H=0.39 S2iH=0.24999999999999978 S1W=8.779 S2iW=8.780164375000002 a=8.75398849357537 b=-6.239347857228599e-06 error_a=0.15587483079701075 error_b=1.0388703810709363e-05
IncidentMedium=Si LambdaRequested=4.25 S1H=0.39 S2iH=0.24999999999999978 S1W=20.002 S2iW=19.999844375000002 a=28.31954243229449 b=0.0002003050656095656 error_a=0.7130628472852898 error_b=4.9196407008843005e-05
IncidentMedium=Si LambdaRequested=4.25 S1H=0.77 S2iH=0.49312 S1W=12.489000000000004 S2iW=12.485564375000003 a=56.96110033165272 b=0.00045559347475948174 error_a=1.4432418996052785 error_b=9.964396884662548e-05
IncidentMedium=Si LambdaRequested=4.25 S1H=0.774 S2iH=0.4930399999999997 S1W=20.001000000000005 S2iW=20.000244375 a=95.4881689206927 b=0.0016575755736445996 error_a=3.2570515587675617 error_b=0.000232019634982032
IncidentMedium=Si LambdaRequested=4.25 S1H=1.525 S2iH=0.976 S1W=16.384000000000004 S2iW=16.395444375000004 a=287.7419292479784 b=0.005562308984045385 error_a=9.969604764598307 error_b=0.0007110247627138489
IncidentMedium=Si LambdaRequested=4.25 S1H=1.528 S2iH=0.976 S1W=20.004 S2iW=20.000244375 a=332.49023403588535 b=0.008767781144698134 error_a=14.607696123771715 error_b=0.0010689456945882393
IncidentMedium=Si LambdaRequested=4.25 S1H=3.016 S2iH=1.9319199999999999 S1W=20.003000000000004 S2iW=20.000164375 a=1251.1589339171892 b=0.03449397209395385 error_a=54.91140386385528 error_b=0.0040175332367975046
14 changes: 14 additions & 0 deletions reduction/data/sf_201043_Si.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# y=a+bx
#
# LambdaRequested[Angstroms] S1H[mm] (S2/Si)H[mm] S1W[mm] (S2/Si)W[mm] a b error_a error_b
#
# Medium=air, runs: [201051, 201052, 201053, 201054, 201055, 201056, 201057, 201058, 201059, 201060, 201061, 201062]
IncidentMedium=Si LambdaRequested=9.74 S1H=0.39 S2iH=0.24999999999999978 S1W=20.002000000000002 S2iW=20.000244375 a=1.1671592747430732 b=-4.575470382337966e-07 error_a=0.04956515865617629 error_b=1.382331509016082e-06
IncidentMedium=Si LambdaRequested=7.043 S1H=0.391 S2iH=0.24999999999999978 S1W=19.99 S2iW=19.991024375000003 a=8.186552063545838 b=3.795923132220985e-05 error_a=0.29744031203729066 error_b=1.1952923150295317e-05
IncidentMedium=Si LambdaRequested=4.25 S1H=0.389 S2iH=0.24999999999999978 S1W=8.783 S2iW=8.780004375 a=6.474967560474706 b=7.776248134900644e-05 error_a=0.13535728446120027 error_b=9.203706891404e-06
IncidentMedium=Si LambdaRequested=4.25 S1H=0.391 S2iH=0.24999999999999978 S1W=19.999000000000002 S2iW=20.000084375 a=26.686768204599762 b=0.0006484376356489566 error_a=0.8143341219382149 error_b=5.719652390108068e-05
IncidentMedium=Si LambdaRequested=4.25 S1H=0.769 S2iH=0.4933599999999998 S1W=12.486 S2iW=12.485724375 a=48.17219594897623 b=0.0010321580008204518 error_a=1.4238750607351318 error_b=9.977020818630609e-05
IncidentMedium=Si LambdaRequested=4.25 S1H=0.768 S2iH=0.49295999999999984 S1W=19.999000000000002 S2iW=20.000324375 a=108.65911487966747 b=0.0028881005532845026 error_a=4.060490860663266 error_b=0.00029135644081117055
IncidentMedium=Si LambdaRequested=4.25 S1H=1.5219999999999998 S2iH=0.976 S1W=16.393 S2iW=16.395524375 a=277.2710779614285 b=0.00850484127651992 error_a=10.701254444053086 error_b=0.0007695824232633795
IncidentMedium=Si LambdaRequested=4.25 S1H=1.523 S2iH=0.976 S1W=20.001000000000005 S2iW=20.000404375000002 a=374.58091362065824 b=0.014194768686571024 error_a=18.247885217429356 error_b=0.001344741548435752
IncidentMedium=Si LambdaRequested=4.25 S1H=3.015 S2iH=1.93208 S1W=20.002000000000002 S2iW=20.000244375 a=1313.1162720578084 b=0.06565073970007965 error_a=70.37367945538153 error_b=0.005210902249029908
16 changes: 8 additions & 8 deletions reduction/data/template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down Expand Up @@ -97,7 +97,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down Expand Up @@ -144,7 +144,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down Expand Up @@ -191,7 +191,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down Expand Up @@ -238,7 +238,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down Expand Up @@ -285,7 +285,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down Expand Up @@ -332,7 +332,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down Expand Up @@ -379,7 +379,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down
14 changes: 7 additions & 7 deletions reduction/data/template_201282.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<q_step>0.015</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_201043_Si.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_201043_Si.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<fourth_column_flag>True</fourth_column_flag>
Expand Down Expand Up @@ -102,7 +102,7 @@
<q_step>0.015</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_201043_Si.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_201043_Si.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<fourth_column_flag>True</fourth_column_flag>
Expand Down Expand Up @@ -153,7 +153,7 @@
<q_step>0.015</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_201043_Si.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_201043_Si.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<fourth_column_flag>True</fourth_column_flag>
Expand Down Expand Up @@ -204,7 +204,7 @@
<q_step>0.015</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_201043_Si.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_201043_Si.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<fourth_column_flag>True</fourth_column_flag>
Expand Down Expand Up @@ -255,7 +255,7 @@
<q_step>0.015</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_201043_Si.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_201043_Si.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<fourth_column_flag>True</fourth_column_flag>
Expand Down Expand Up @@ -306,7 +306,7 @@
<q_step>0.015</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_201043_Si.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_201043_Si.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<fourth_column_flag>True</fourth_column_flag>
Expand Down Expand Up @@ -357,7 +357,7 @@
<q_step>0.015</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_201043_Si.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_201043_Si.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<fourth_column_flag>True</fourth_column_flag>
Expand Down
16 changes: 8 additions & 8 deletions reduction/data/template_short_nobck.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down Expand Up @@ -94,7 +94,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down Expand Up @@ -141,7 +141,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down Expand Up @@ -188,7 +188,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down Expand Up @@ -235,7 +235,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down Expand Up @@ -282,7 +282,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down Expand Up @@ -329,7 +329,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down Expand Up @@ -376,7 +376,7 @@
<q_step>0.02</q_step>
<q_min>0.005</q_min>
<scaling_factor_flag>True</scaling_factor_flag>
<scaling_factor_file>/SNS/REF_L/IPTS-30101/shared/autoreduce/sf_197912_Si_auto.cfg</scaling_factor_file>
<scaling_factor_file>data/sf_197912_Si_auto.cfg</scaling_factor_file>
<incident_medium_list>Si</incident_medium_list>
<incident_medium_index_selected>0</incident_medium_index_selected>
<slits_width_flag>True</slits_width_flag>
Expand Down
19 changes: 11 additions & 8 deletions reduction/test/test_reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import mantid
import mantid.simpleapi as mtd_api
import numpy as np
mtd_api.config["default.facility"] = "SNS"
mtd_api.config["default.instrument"] = "REF_L"

mantid.kernel.config.setLogLevel(3)

Expand All @@ -14,12 +16,10 @@ def test_full_reduction():
Test the fill reduction chain
"""
template_path = 'data/template.xml'

qz_all = []
refl_all = []
d_refl_all = []
first_run = None

for run_number in range(198409, 198417):
ws_sc = mtd_api.Load("REF_L_%s" % run_number)
qz_mid, refl, d_refl = template.process_from_template_ws(ws_sc, template_path)
Expand Down Expand Up @@ -50,9 +50,10 @@ def test_full_reduction():

def test_reduce_workflow():
template_path = 'data/template.xml'
output_dir = '/tmp'
output_dir = 'data/'
reduced_path = os.path.join(output_dir, 'REFL_198409_combined_data_auto.txt')
os.remove(reduced_path)
if os.path.isfile(reduced_path):
os.remove(reduced_path)

for i in range(198409, 198417):
ws = mtd_api.Load("REF_L_%s" % i)
Expand All @@ -79,9 +80,10 @@ def test_reduce_workflow_201282():
Test to reproduce autoreduction output
"""
template_path = 'data/template_201282.xml'
output_dir = '/tmp'
output_dir = 'data/'
reduced_path = os.path.join(output_dir, 'REFL_201282_combined_data_auto.txt')
os.remove(reduced_path)
if os.path.isfile(reduced_path):
os.remove(reduced_path)

for i in range(201282, 201289):
ws = mtd_api.Load("REF_L_%s" % i)
Expand All @@ -108,9 +110,10 @@ def test_background_subtraction():
Test with background subtraction off for the data and on for the normalization
"""
template_path = 'data/template_short_nobck.xml'
output_dir = '/tmp'
output_dir = 'data/'
reduced_path = os.path.join(output_dir, 'REFL_198382_combined_data_auto.txt')
os.remove(reduced_path)
if os.path.isfile(reduced_path):
os.remove(reduced_path)

for i in range(198388, 198390):
ws = mtd_api.Load("REF_L_%s" % i)
Expand Down
Loading