@sh.add_function(dsp, outputs=['validated_base'], **_kw)
def validate_base(
input_type, base=None, declaration_mode=False, hard_validation=False,
enable_selector=False, type_approval_mode=False):
"""
Validate base data.
:param input_type:
Type of file input.
:type input_type: str
:param base:
Base data.
:type base: dict
:param declaration_mode:
Use only the declaration data.
:type declaration_mode: bool
:param hard_validation:
Add extra data validations.
:type hard_validation: bool
:param enable_selector:
Enable the selection of the best model to predict both H/L cycles.
:type enable_selector: bool
:param type_approval_mode:
Is launched for TA?
:type type_approval_mode: bool
:return:
Validated base data.
:rtype: dict
"""
i, e = _validate_base_with_schema(base or {})
i, e = _mode_parser(
type_approval_mode, declaration_mode, hard_validation, i, e, input_type
)
if _log_errors_msg(e):
return sh.NONE
i['enable_selector'] = enable_selector
return {'.'.join(k): v for k, v in sh.stack_nested_keys(i, depth=3)}