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
3fd77427
Commit
3fd77427
authored
1 year ago
by
Karim Ahmed
Browse files
Options
Downloads
Patches
Plain Diff
add tests
parent
a8e4eef9
No related branches found
No related tags found
1 merge request
!960
[LPD][Dark ] Sort Dark runs by Gain
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_lpdlib.py
+27
-0
27 additions, 0 deletions
tests/test_lpdlib.py
with
27 additions
and
0 deletions
tests/test_lpdlib.py
0 → 100644
+
27
−
0
View file @
3fd77427
import
pytest
from
cal_tools.lpdlib
import
sort_dark_runs_by_gain
@pytest.mark.requires_gpfs
def
test_sort_dark_runs_by_gain
():
# TODO: update used raw data to test data when available.
raw_folder
=
"
/gpfs/exfel/exp/CALLAB/202130/p900203/raw
"
ctrl_src
=
"
FXE_DET_LPD1M-1/COMP/FEM_MDL_COMP
"
runs
=
[
9008
,
9010
,
9009
]
sorted_runs
=
sort_dark_runs_by_gain
(
raw_folder
,
runs
,
ctrl_src
)
assert
sorted_runs
==
[
9008
,
9009
,
9010
]
@pytest.mark.requires_gpfs
def
test_raise_sort_dark_runs_by_gain
():
# TODO: update used raw data to test data when available.
raw_folder
=
"
/gpfs/exfel/exp/CALLAB/202130/p900203/raw
"
ctrl_src
=
"
FXE_DET_LPD1M-1/COMP/FEM_MDL_COMP
"
runs
=
[
9008
,
9009
]
with
pytest
.
raises
(
AssertionError
)
as
err
:
sort_dark_runs_by_gain
(
raw_folder
,
runs
,
ctrl_src
)
runs
=
[
9008
,
9008
,
9009
]
# dynamicgain, dynamicgain, fixgain2
with
pytest
.
raises
(
ValueError
)
as
err
:
sort_dark_runs_by_gain
(
raw_folder
,
runs
,
ctrl_src
)
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