veriflow.configuration.config#
The definition of the configuration settings.
This definition is used both as the schema for the configuration yaml file, and as the content of the veriflow configuration object.
To generate a yaml / json file with the json representation of this schema:
import pathlib
import yaml
from veriflow.configuration import Config
FILEPATH = pathlib.Path("YOUR_PATH_HERE")
with FILEPATH.open("w") as myfile:
yaml.dump(Config.model_json_schema(), myfile)
Classes
|
Config object for running the verification pipeline. |
|
Supported schema versions for the config file. |
- class veriflow.configuration.config.Config(*, version=SupportedSchemaVersion.V0, general, datasources, scores, datasinks=None, id_mapping=None)[source]#
Config object for running the verification pipeline.
- Parameters:
version (SupportedSchemaVersion)
general (GeneralInfoConfig)
datasources (Annotated[Sequence[BaseDatasourceConfig], MinLen(min_length=1)])
scores (Annotated[Sequence[BaseScoreConfig], MinLen(min_length=1)])
datasinks (Annotated[Sequence[BaseDatasinkConfig] | None, MinLen(min_length=1)])
id_mapping (IdMappingConfig | None)
- version: SupportedSchemaVersion#
- general: GeneralInfoConfig#
- datasources: Annotated[Sequence[BaseDatasourceConfig], FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])]#
- scores: Annotated[Sequence[BaseScoreConfig], FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])]#
- datasinks: Annotated[Sequence[BaseDatasinkConfig] | None, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])]#
- id_mapping: IdMappingConfig | None#
- static write_schema(output_path, user_datasources_config=None, users_scores_config=None, user_datasinks_config=None)[source]#
Generate a YAML schema from the Pydantic model.
By default, will write the schema for all default implementations of datasources, scores and datasinks. If you’re using user-implementations of any of these, you can provide these classes to the function. This function will then add your user-implementation to the schema, together with the default implementations. As a result, YAML language support tools will be able to support both default and user-implementations. For example, by using the YAML extension in VSCode, using CTRL+SPACE will automatically suggest fields, based on the schema for both the default and user implementations.
- Parameters:
output_path (Path) – Where to write the schema.
user_datasources_config (list[type[BaseDatasourceConfig]] | None, optional) – Option to provide user-implemented config classes, by default None
users_scores_config (list[type[BaseScoreConfig]] | None, optional) – Option to provide user-implemented config classes, by default None
user_datasink_config (list[type[BaseDatasinkConfig]] | None, optional) – Option to provide user-implemented config classes, by default None
user_datasinks_config (list[type[BaseDatasinkConfig]] | None)
- Return type:
None