schema_attribute_validators

The built-in functions to validate known attributes.

Template for the functions: attribute_checker_template(hed_schema, tag_entry, attribute_name, possible_values):

hed_schema (HedSchema): The schema to use for validation tag_entry (HedSchemaEntry): The schema entry for this tag. attribute_name (str): The name of this attribute

returns:

bool

Functions

allowed_characters_check(hed_schema, ...)

Check allowed character has a valid value

conversion_factor(hed_schema, tag_entry, ...)

in_library_check(hed_schema, tag_entry, ...)

Check allowed character has a valid value

tag_exists_base_schema_check(hed_schema, ...)

Check if the single tag is a partnered schema tag

tag_exists_check(hed_schema, tag_entry, ...)

Check if the list of possible tags exists in the schema.

tag_is_deprecated_check(hed_schema, ...)

Check if the tag has a valid deprecatedFrom attribute, and that any children have it

tag_is_placeholder_check(hed_schema, ...)

Check if comma separated list has valid HedTags.

unit_class_exists(hed_schema, tag_entry, ...)

unit_exists(hed_schema, tag_entry, ...)

value_class_exists(hed_schema, tag_entry, ...)

allowed_characters_check(hed_schema, tag_entry, attribute_name)[source]

Check allowed character has a valid value

Parameters:
  • hed_schema (HedSchema) – The schema to use for validation

  • tag_entry (HedSchemaEntry) – The schema entry for this attribute.

  • attribute_name (str) – The name of this attribute

Returns:

A list of issues. Each issue is a dictionary.

Return type:

list

conversion_factor(hed_schema, tag_entry, attribute_name)[source]
in_library_check(hed_schema, tag_entry, attribute_name)[source]

Check allowed character has a valid value

Parameters:
  • hed_schema (HedSchema) – The schema to use for validation

  • tag_entry (HedSchemaEntry) – The schema entry for this attribute.

  • attribute_name (str) – The name of this attribute

Returns:

A list of issues. Each issue is a dictionary.

Return type:

list

tag_exists_base_schema_check(hed_schema, tag_entry, attribute_name)[source]

Check if the single tag is a partnered schema tag

Parameters:
  • hed_schema (HedSchema) – The schema to use for validation

  • tag_entry (HedSchemaEntry) – The schema entry for this tag.

  • attribute_name (str) – The name of this attribute

Returns:

A list of issues. Each issue is a dictionary.

Return type:

list

tag_exists_check(hed_schema, tag_entry, attribute_name)[source]

Check if the list of possible tags exists in the schema.

Parameters:
  • hed_schema (HedSchema) – The schema to use for validation

  • tag_entry (HedSchemaEntry) – The schema entry for this tag.

  • attribute_name (str) – The name of this attribute

Returns:

A list of issues. Each issue is a dictionary.

Return type:

list

tag_is_deprecated_check(hed_schema, tag_entry, attribute_name)[source]

Check if the tag has a valid deprecatedFrom attribute, and that any children have it

Parameters:
  • hed_schema (HedSchema) – The schema to use for validation

  • tag_entry (HedSchemaEntry) – The schema entry for this tag.

  • attribute_name (str) – The name of this attribute

Returns:

A list of issues. Each issue is a dictionary.

Return type:

list

tag_is_placeholder_check(hed_schema, tag_entry, attribute_name)[source]

Check if comma separated list has valid HedTags.

Parameters:
  • hed_schema (HedSchema) – The schema to use for validation

  • tag_entry (HedSchemaEntry) – The schema entry for this tag.

  • attribute_name (str) – The name of this attribute

Returns:

A list of issues. Each issue is a dictionary.

Return type:

list

unit_class_exists(hed_schema, tag_entry, attribute_name)[source]
unit_exists(hed_schema, tag_entry, attribute_name)[source]
value_class_exists(hed_schema, tag_entry, attribute_name)[source]