Problem
- Currently all possible validators are options in the constructor of
HeaderCard or Column. This is not very flexible, and means there are e.g. string validation options for numerical values, etc.
- We don't have a way to validate things like UCDs, or UUIDs, which are strings.
Proposed Solution(s)
- Change how
type=x are specified to use a Type class hierarchy, which has validators inside. Then you just giev e.g. Column(type=UUID,...)
- Allow a list of "validator classes" (independent of type), like in pydantic, e.g.
HeaderCard(validators=[ValidUUID, MaxLength(50)]). That may be more flexible if there are many types of validation, but it's a bit more wordy and the same can be achieved by (1)
Required header checks:
These are needed for doing proper validation of headers (and maybe also columns in some cases):
- is valid ISO time string (needed for
DATE* headers)
- is valid MJD (maybe range min/max is enough however)
- is valid unit (needed for
TIMEUNIT header)
- is valid UUID (needed for data product IDs)
- is valid URI or Path (needed for
GROUP tables)
Problem
HeaderCardorColumn. This is not very flexible, and means there are e.g. string validation options for numerical values, etc.Proposed Solution(s)
type=xare specified to use aTypeclass hierarchy, which has validators inside. Then you just giev e.g.Column(type=UUID,...)HeaderCard(validators=[ValidUUID, MaxLength(50)]). That may be more flexible if there are many types of validation, but it's a bit more wordy and the same can be achieved by (1)Required header checks:
These are needed for doing proper validation of headers (and maybe also columns in some cases):
DATE*headers)TIMEUNITheader)GROUPtables)