validate_metadata#

brainglobe_atlasapi.atlas_generation.validate_atlases.validate_metadata(atlas: BrainGlobeAtlas)[source]#

Validate the atlas metadata.

Checks that the metadata of the given atlas has the correct format. Specifically, it ensures that all required keys from METADATA_TEMPLATE are present and that the types of the values match the types specified in METADATA_TEMPLATE.

Parameters:

atlas (BrainGlobeAtlas) – The BrainGlobeAtlas object whose metadata is to be validated.

Returns:

True if the metadata adheres to the expected format and types.

Return type:

bool

Raises:

AssertionError – If a required key is missing from the metadata or if the type of a metadata value does not match the expected type.