Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate YAML schema and format in parameter files #911

Closed
rvhonorato opened this issue Jun 26, 2024 · 0 comments · Fixed by #913
Closed

Validate YAML schema and format in parameter files #911

rvhonorato opened this issue Jun 26, 2024 · 0 comments · Fixed by #913
Assignees
Labels
enhancement Enhancing an existing feature of adding a new one yaml default parameters Anything related to the YAML configuration files for default parameters

Comments

@rvhonorato
Copy link
Member

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;

def read_from_yaml(yaml_file: FilePath) -> dict[Any, Any]:

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

@rvhonorato rvhonorato added enhancement Enhancing an existing feature of adding a new one yaml default parameters Anything related to the YAML configuration files for default parameters labels Jun 26, 2024
@VGPReys VGPReys self-assigned this Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancing an existing feature of adding a new one yaml default parameters Anything related to the YAML configuration files for default parameters
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants