The testing module

nomenclature.testing.assert_valid_yaml(path)[source]

Assert that all yaml files in path can be parsed without errors

nomenclature.testing.assert_valid_structure(path, definitions='definitions', mappings=None, required_data=None, dimensions=None)[source]

Assert that path can be initialized as a DataStructureDefinition

Parameters:
pathPath

Project directory to be validated

definitionsstr, optional

Name of the definitions folder, defaults to “definitions”

mappingsstr, optional

Name of the mappings folder, defaults to “mappings” (if this folder exists)

required_datastr, optional

Name of the required data folder, defaults to “required_data” (if this folder exists)

dimensionsList[str], optional

Dimensions to be checked, defaults to all sub-folders of definitions

Notes

Folder structure of path:
  • A definitions folder is required and must be a valid

DataStructureDefinition - The definitions folder must contain sub-folder(s) to validate - If a mappings folder exists, it must be a valid RegionProcessor