validators
Generic/reusable validators for parameter models.
Functions:
Name | Description |
---|---|
template_parameter_validator |
Prepare a model which accepts template parameters for validation. |
template_parameter_validator(template_params_name)
Populates a TaskParameters model with a set of validated TemplateParameters.
This validator is intended for use with third-party Task's which use a templated configuration file. The validated template parameters are passed as a dictionary through a single parameter in the TaskParameters model. This dictionary is typically actually a separate pydantic BaseModel defined either within the TaskParameter class or externally. The other model provides the initial validation of each individual template parameter.
This validator populates the TaskParameter model with the template parameters.
It then returns None
for the initial parameter that held these parameters.
Returning None ensures that no attempt is made to pass the parameters on the
command-line/when launching the third-party Task.
Source code in lute/io/models/validators.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
validate_smd_path(smd_path_name)
Finds the path to a valid Smalldata file or raises an error.
Source code in lute/io/models/validators.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|