Closed rvhonorato closed 3 weeks ago
Description
The modules use a .yaml file to define its parameters - however their format and schema are not validated on loading.
.yaml
So it's possible to add repeated parameters or parameters missing specific fields.
Since the schema is not validated, you will only observe errors at runtime, in a specific module, in a specific condition.
Describe the solution you'd like
libio.read_from_yaml should be refactored to do a schema/format validation;
libio.read_from_yaml
https://github.com/haddocking/haddock3/blob/48f59fbb875faf67646346964184cffd160f1e9e/src/haddock/libs/libio.py#L87
Additional context
There is no built-in python way of doing this faik, but there are several third-party librares for this such as pydantic-yaml and strictyaml
pydantic-yaml
strictyaml
Description
The modules use a
.yaml
file to define its parameters - however their format and schema are not validated on loading.So it's possible to add repeated parameters or parameters missing specific fields.
Since the schema is not validated, you will only observe errors at runtime, in a specific module, in a specific condition.
Describe the solution you'd like
libio.read_from_yaml
should be refactored to do a schema/format validation;https://github.com/haddocking/haddock3/blob/48f59fbb875faf67646346964184cffd160f1e9e/src/haddock/libs/libio.py#L87
Additional context
There is no built-in python way of doing this faik, but there are several third-party librares for this such as
pydantic-yaml
andstrictyaml