Change to pydantic model based validation of the system config file
AIM
System config validation changed to pydantic
based model validation. A new exception class created to simplify the error messages displayed.
AUXILLARY CHANGES
Associated update to unit tests.
DETAILS
- All pydantic based models for system configuration included to file
src/swatch/stubs.py
. - Corresponding changes made to
src/swatch/config.py
to allow pydantic based validation of the system config yaml input file. - Requirements for pydantic model enabled in
requirements.txt
. - New exception
ConfigValidationError
defined insrc/swatch/exceptions.py
which handles theValidationError
generated by pydantic for simplified user readable error message. - Minimal updates to
tests/config/test_parse_parameter_file__.py
andtests/config/test_parse_system_file__.py
such that the new tests are compatible with incoming changes. - Functions
expand_link_id()
andparse_index_list_string()
changed to corresponding internal functions_expand_link_id()
and_parse_index_list_string()
. The test function for these were subsequently changed totest__<FUNCTION_NAME>__()
to create a new nomenclature for test functions for internal functions.
CORRESPONDING CODE CHANGES
Requires !116 (merged) . Fixes #40 .
Edited by Abanti Ranadhir Sahasransu