validate_file_using_schema#

Validate a file or files in a directory using a schema.

Input files can be metadata, schema, or data files in yaml, json, or ecsv format.

Command line arguments#

file_name (str)

input file to be validated

model_parameters_directory (str)

directory with json files of model parameters to be validated

schema (str)

schema file (jsonschema format) used for validation

data_type (str)

type of input data (allowed types: metadata, schema, data)

Raises#

FileNotFoundError

if file to be validated is not found

Example#

simtools-validate-file-using-schema \\
 --file_name tests/resources/MLTdata-preproduction.meta.yml \\
 --schema simtools/schemas/metadata.metaschema.yml \\
 --data_type metadata
validate_file_using_schema.validate_data_file(args_dict, logger)[source]#

Validate a data file (e.g., in ecsv, json, yaml format).

validate_file_using_schema.validate_data_files(args_dict, logger)[source]#

Validate data files.

validate_file_using_schema.validate_metadata(args_dict, logger)[source]#

Validate metadata.

validate_file_using_schema.validate_schema(args_dict, logger)[source]#

Validate a schema file given in yaml or json format.

Schema is either given as command line argument, read from the meta_schema_url or from the metadata section of the data dictionary.