Script to validate YAML config against notebooks
Description
When we change the calibration notebooks, the YAML configuration used by the webservice sometimes needs to be modified as well, if we have removed, renamed or changed the type of parameters.
This script can check that config against the parameters in the correct & dark notebooks.
python -m xfel_calibrate.validate_nbs_config
Add --config-dir to specify the config folder path. The default should work for running as xcaltst.
How Has This Been Tested?
Run locally.
Relevant Documents (optional)
Sample output:
Detector Karabo ID not in data mapping
AGIPD64K
file: 202431/900463.yaml
key: dark/SPB
Unknown detector type in data mapping
AGIPD64K
file: 202431/900465.yaml
key: data-mapping/AGIPD64K/detector-type
Type differs from default in notebook
notebook: 'off', config: False
file: 202431/900465.yaml
key: correct/MID/MID_DET_AGIPD1M-1/use-litframe-finder
Type differs from default in notebook
notebook: 'cm', config: False
file: 202431/900465.yaml
key: correct/MID/MID_DET_AGIPD1M-1/use-super-selection
Parameter name not found in notebook
path_inset
file: 202431/900465.yaml
key: dark/DETLAB/SCS_CDIDET_FCCD2M
It currently finds 1113 config issues, although a lot of these are essentially the same issue in various files. The 'agipd64k' detector type comes up quite a few times.
Types of changes
- New feature (non-breaking change which adds functionality)
- Test (additional or refactored tests)
Checklist:
- My code follows the code style of this project.