Fix default values for checks options
Up to now, default values for checks have been given in multiple places (some in parsing.py
, some in a block the top of checks.py
, some as default values for the arguments when running a particular check). In some cases these default values were even different, making it uncertain what value it would take. The application of default values in parsing.py
didn't seem to work as intended either, making it all in all quite unclear what was happening.
This MR aims to simplify this through the following changes:
- Default values are now defined in
parsing.py
only (ie. none inchecks.py
) - Default values for check-type-specific options have been separated from ones common to all check types, so that these values are not unintentionally passed to the wrong check types
-
run_job_checks()
inchecks.py
now accesses values from the checks data dictionary usingdict.get(key)
instead ofdict[key]
, so it can now handle missing optional values without having to usevar = dict[key] if key in dict else default
-style structures everywhere - Functions for running individual check types have been reworked to expect
None
for unspecified optional parameters (ie. ones without defaults inparsing.py
) - Adds some extra requirements for YAML validation for optional arguments for
range
checks
FYI @gtuci
Work related to https://gitlab.cern.ch/lhcb-dpa/project/-/issues/93 and lhcb-dpa&1 (closed)