Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
calibration
pycalibration
Commits
a51a720a
Commit
a51a720a
authored
1 year ago
by
Karim Ahmed
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for sorting dark runs
parent
d156817d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!958
[Gotthard2][Dark] Sort dark runs
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_gotthard2lib.py
+25
-0
25 additions, 0 deletions
tests/test_gotthard2lib.py
with
25 additions
and
0 deletions
tests/test_gotthard2lib.py
0 → 100644
+
25
−
0
View file @
a51a720a
import
pytest
from
cal_tools.gotthard2.gotthard2lib
import
sort_dark_runs_by_gain
def
test_sort_dark_runs_by_gain
():
# TODO: update used raw data to test data when available.
raw_folder
=
"
/gpfs/exfel/exp/FXE/202231/p900298/raw
"
ctrl_src
=
"
FXE_XAD_G2XES/DET/CONTROL
"
runs
=
[
9
,
8
,
7
]
sorted_runs
=
sort_dark_runs_by_gain
(
raw_folder
,
runs
,
ctrl_src
)
assert
sorted_runs
==
[
7
,
8
,
9
]
def
test_raise_sort_dark_runs_by_gain
():
# TODO: update used raw data to test data when available.
raw_folder
=
"
/gpfs/exfel/exp/SA1/202331/p900384/raw
"
ctrl_src
=
"
SA1_XTD9_HIREX/DET/GOTTHARD2_CTRL
"
runs
=
[
60
,
61
,
62
,
63
]
with
pytest
.
raises
(
AssertionError
)
as
err
:
sort_dark_runs_by_gain
(
raw_folder
,
runs
,
ctrl_src
)
runs
=
[
89
,
61
,
63
]
# dynamicgain, dynamicgain, fixgain2
with
pytest
.
raises
(
ValueError
)
as
err
:
sort_dark_runs_by_gain
(
raw_folder
,
runs
,
ctrl_src
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment