Skip to content
Snippets Groups Projects
Commit 99b7000c authored by Karim Ahmed's avatar Karim Ahmed
Browse files

add some documentations

parent fe3916a3
No related branches found
No related tags found
1 merge request!610Add a pytest to run a dict of CALLAB test runs before releases
......@@ -48,7 +48,7 @@ def validate_h5files(
Args:
f: file to validate
ref_folder (_type_): Reference folder which has the same filename
ref_folder: Reference folder which has the same filename
as of the file to validate.
Returns:
......@@ -96,13 +96,13 @@ def validate_constant_file(
h5_copy_except.h5_copy_except_paths(
sfile,
hp1,
["report", "creation_time"],
["report"],
)
with h5py.File(ref_folder / test_file.name, "r") as sfile:
h5_copy_except.h5_copy_except_paths(
sfile,
hp2,
["report", "creation_time"],
["report"],
)
hp1.close()
hp2.close()
......@@ -152,7 +152,25 @@ def test_xfel_calibrate(
test_key: str, val_dict: dict, release_test_config: Tuple[bool, bool, bool, bool]
):
"""Test xfel calibrate detectors and calibrations written
in the given callab_test YAML file.
in the given callab_test.py file.
xfel-calibrate CL is ran over each test_key. Expected a val_dict of
1. out-folder, 2. in-folder, 3. run numbers, 4.karabo-id, 5. detector type
6. calibration type, and 7. reference folder to compare the data with.
The val_dict can/should acquire the needed custom configurations for each test.
e.g. AGIPD notebooks needs to differentiate between the different `karabo-id-control`
which differ across instruments.
Each calibration test is ran sequentially. Each calibration test consists of multiple tests.
1. Testing if all SLURM jobs were successfull.
2. Testing if there is an available report.
3. Validate number of H5 files against files in reference folder.
4. Validate numberical values for the H5 files against reference files.
a. CORRECTED files are compared using MD5 checksum.
b. CONSTANTS local files saved using cal_tools are the one being tested.
Unfortunately they can't be compared using MD5 checksum. As the metadata in files
consists of the report path. which differ between each test. So the metadata is cleaned
from the report path first before comparing the H5 constant files numerically.
Args:
test_key : Key for the xfel-calibrate test.
val_dict: Dictionary of the configurations for the running test.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment