schema_attribute_validators¶
The built-in functions to validate known attributes.
Template for the functions:
attribute_checker_template(hed_schema, tag_entry, attribute_name)
: -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 found validating this attribute
- rtype:
issues (list)
Functions
|
Check allowed character has a valid value |
|
Check if the attribute is deprecated. |
|
Check if the conversion_factor on is valid |
|
Check if the library attribute is a valid schema name |
|
Check if the attribute is a valid numeric(float) value |
|
Check if the list of possible items exists in the schema and are not deprecated. |
|
Check if the single tag is a partnered schema tag |
|
Check if the element has a valid deprecatedFrom attribute, and that any children have it |
|
Check if comma separated list has valid HedTags. |
|
Check the given unit is valid, and not deprecated. |
- 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 tag.
attribute_name (str) – The name of this attribute
- Returns:
A list of issues from validating this attribute.
- Return type:
issues(list)
- attribute_is_deprecated(hed_schema, tag_entry, attribute_name)[source]¶
Check if the attribute is deprecated. does not check value.
- 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 from validating this attribute.
- Return type:
issues(list)
- conversion_factor(hed_schema, tag_entry, attribute_name)[source]¶
Check if the conversion_factor on is valid
- 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 from validating this attribute.
- Return type:
issues(list)
- in_library_check(hed_schema, tag_entry, attribute_name)[source]¶
Check if the library attribute is a valid schema name
- 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 from validating this attribute.
- Return type:
issues(list)
- is_numeric_value(hed_schema, tag_entry, attribute_name)[source]¶
Check if the attribute is a valid numeric(float) value
- 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 from validating this attribute.
- Return type:
issues(list)
- item_exists_check(hed_schema, tag_entry, attribute_name, section_key)[source]¶
Check if the list of possible items exists in the schema and are not deprecated.
- 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
section_key (HedSectionKey) – The section this item should be in. This is generally passed via functools.partial
- Returns:
A list of issues from validating this attribute.
- Return type:
issues(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 from validating this attribute.
- Return type:
issues(list)
- tag_is_deprecated_check(hed_schema, tag_entry, attribute_name)[source]¶
Check if the element 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 from validating this attribute.
- Return type:
issues(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 from validating this attribute.
- Return type:
issues(list)
- unit_exists(hed_schema, tag_entry, attribute_name)[source]¶
Check the given unit is valid, and not deprecated.
- 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 from validating this attribute.
- Return type:
issues(list)