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
5fff3ca6
Commit
5fff3ca6
authored
2 years ago
by
Karim Ahmed
Browse files
Options
Downloads
Patches
Plain Diff
add test
parent
a2280278
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!738
New calcat interface
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
setup.py
+1
-0
1 addition, 0 deletions
setup.py
tests/test_calcat_interface.py
+81
-0
81 additions, 0 deletions
tests/test_calcat_interface.py
with
82 additions
and
0 deletions
setup.py
+
1
−
0
View file @
5fff3ca6
...
...
@@ -110,6 +110,7 @@ if "readthedocs.org" not in sys.executable:
install_requires
+=
[
"
iCalibrationDB @ git+ssh://git@git.xfel.eu:10022/detectors/cal_db_interactive.git@2.3.0
"
,
# noqa
"
XFELDetectorAnalysis @ git+ssh://git@git.xfel.eu:10022/karaboDevices/pyDetLib.git@2.7.0
"
,
# noqa
"
calibration_client @ git+ssh://git.xfel.eu:10022/ITDM/calibration_client.git@410e48bbff84b0d011a332cac95e3c8b499e9a28
"
]
setup
(
...
...
This diff is collapsed.
Click to expand it.
tests/test_calcat_interface.py
0 → 100644
+
81
−
0
View file @
5fff3ca6
"""
TEST CALCAT INTERFACE:
1- AGIPD_CalibrationData/ CalibrationData / metadata()
2- physical_detector_units().
"""
import
pytest
from
cal_tools.calcat_interface
import
AGIPD_CalibrationData
,
DSSC_CalibrationData
@pytest.mark.requires_gpfs
@pytest.mark.parametrize
(
"
mod,mod_naming
"
,
[
(
"
AGIPD00
"
,
"
da
"
),
(
"
Q1M1
"
,
"
qm
"
),
(
0
,
"
modno
"
),
]
)
def
test_AGIPD_CalibrationData
(
mod
,
mod_naming
):
"""
Test CalibrationData through AGIPD_CalibrationData
and test metadata method.
Args:
mod (str): Module name
mod_naming (str): Selected module naming
"""
agipd_md
=
AGIPD_CalibrationData
(
detector_name
=
"
SPB_DET_AGIPD1M-1
"
,
sensor_bias_voltage
=
300
,
memory_cells
=
352
,
acquisition_rate
=
1.1
,
integration_time
=
12
,
source_energy
=
9.2
,
gain_mode
=
0
,
gain_setting
=
0
,
event_at
=
"
2020-01-07 13:26:48.00
"
,
modules
=
[
mod
],
client
=
None
,
module_naming
=
mod_naming
).
metadata
()
assert
isinstance
(
agipd_md
,
dict
)
assert
list
(
agipd_md
.
keys
())[
0
]
==
mod
@pytest.mark.parametrize
(
"
mod,mod_naming
"
,
[
(
"
DSSC00
"
,
"
da
"
),
(
"
Q1M1
"
,
"
qm
"
),
(
0
,
"
modno
"
),
]
)
def
test_physical_detector_units
(
mod
,
mod_naming
):
"""
Test physical_detector_units property.
Args:
mod (str): Module name
mod_naming (str): Selected module naming
"""
agipd_cal
=
DSSC_CalibrationData
(
detector_name
=
"
SCS_DET_DSSC1M-1
"
,
sensor_bias_voltage
=
300
,
memory_cells
=
400
,
pulse_id_checksum
=
None
,
acquisition_rate
=
None
,
target_gain
=
None
,
encoded_gain
=
None
,
event_at
=
"
2020-01-07 13:26:48.00
"
,
modules
=
[
mod
],
client
=
None
,
module_naming
=
mod_naming
)
pdus
=
agipd_cal
.
physical_detector_units
assert
isinstance
(
pdus
,
dict
)
assert
len
(
pdus
)
==
16
assert
list
(
pdus
.
keys
())[
0
]
==
mod
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