You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The yaml header is meant to be flexible and there is no imposition of any specific fields that must be there. However, there are fields that, if present, must follow certain schema. An example of this are the CSV dialect (that will be implemented in #2) and the Tabular schema (implemented in #3). It is easy to see that other applications and tools might require their own strict set of fields, eg. an measurement equipment that provides as metadata machine make and model, start and end time of the measurements, and some specific machine settings. All of those must be there if the metadata is to truly represent the data it is accompanying.
Proposed solution
Implement a validator registry that will run specific, known validators on the header if a given field is present. Eg. assuming #3 is implemented
@register_validator(name="tabular")classTabularSchema(...)
...
# and then, when reading the yaml headerforfield, validatorinVALIDATORS_REGISTRY.items():
iffieldinyaml_header:
yaml_header[field] =validator(field)
So the TabularSchema validator will run if tabular is a top level field in the yaml header. The same would be done when saving the data, but in that case, the validator would be dumping the data to a dict, so it can be saved.
This issue is not about implementing any specific validator, but about setting up the infrastructure for registering and running them.
The text was updated successfully, but these errors were encountered:
Problem
The yaml header is meant to be flexible and there is no imposition of any specific fields that must be there. However, there are fields that, if present, must follow certain schema. An example of this are the CSV dialect (that will be implemented in #2) and the Tabular schema (implemented in #3). It is easy to see that other applications and tools might require their own strict set of fields, eg. an measurement equipment that provides as metadata machine make and model, start and end time of the measurements, and some specific machine settings. All of those must be there if the metadata is to truly represent the data it is accompanying.
Proposed solution
Implement a validator registry that will run specific, known validators on the header if a given field is present. Eg. assuming #3 is implemented
So the TabularSchema validator will run if
tabular
is a top level field in the yaml header. The same would be done when saving the data, but in that case, the validator would be dumping the data to a dict, so it can be saved.This issue is not about implementing any specific validator, but about setting up the infrastructure for registering and running them.
The text was updated successfully, but these errors were encountered: