Closed mhidas closed 5 years ago
I would rename it to match the usage:
@ocehugo I'm not sure I understand your suggestion. How do the concepts of schema validation, completeness and consistency (as described above) map to your names?
I think these concepts are independent of whether you're talking about a netcdf file or a template. Actually the only difference is that a DatasetTemplate object is able to represent an incomplete, inconsistent template, but you can't write a netcdf until you've satisfied all three conditions.
(So maybe I've just answered my own question...)
Just to get it clear in my head before I start messing around in the code, here's what I'm thinking
At template creation time, just validate the dictionaries (or JSON) provided against the schema we have already specified. Checks include
At netCDF writing time (just before attempting to write the file)
There are different levels of validation we can apply at different stages:
jsonschema
at template creation time. It can't be too restrictive because it may not make sense to fully specify all dataset elements in a JSON template (e.g. a generic template could specify the attributes of a TEMP variable, without saying what dimensions it should have).I think validation can be applied at the beginning, but checking for completeness and consistency can be left until just before creating the file. The code is doing something close to this already, but we need to make sure it's doing the right amount of validation at each stage.