GroupValidator¶
- class GroupValidator(hed_schema)[source]
Validation for attributes across groups HED tags.
This is things like Required, Unique, top level tags, etc.
Methods
|
Constructor for GroupValidator |
Report missing required tags. |
|
Report if multiple identical unique tags exist |
|
Report tags incorrectly positioned in hierarchy. |
|
Report invalid the multi-tag properties in a HED string, e.g. |
|
Report invalid groups at each level. |
|
Validate Duration/Delay tag groups |
Attributes
- GroupValidator.__init__(hed_schema)[source]¶
Constructor for GroupValidator
- Parameters:
hed_schema (HedSchema) – A HedSchema object.
- GroupValidator.check_for_required_tags(tags)[source]¶
Report missing required tags.
- Parameters:
tags (list) – HedTags containing the tags.
- Returns:
Validation issues. Each issue is a dictionary.
- Return type:
list
- GroupValidator.check_multiple_unique_tags_exist(tags)[source]¶
Report if multiple identical unique tags exist
A unique Term can only appear once in a given HedString. Unique terms are terms with the ‘unique’ property in the schema.
- Parameters:
tags (list) – HedTags containing the tags.
- Returns:
Validation issues. Each issue is a dictionary.
- Return type:
list
- static GroupValidator.check_tag_level_issue(original_tag_list, is_top_level, is_group)[source]¶
Report tags incorrectly positioned in hierarchy.
Top-level groups can contain definitions, Onset, etc. tags.
- Parameters:
original_tag_list (list) – HedTags containing the original tags.
is_top_level (bool) – If True, this group is a “top level tag group”.
is_group (bool) – If True group should be contained by parenthesis.
- Returns:
Validation issues. Each issue is a dictionary.
- Return type:
list
- GroupValidator.run_all_tags_validators(hed_string_obj)[source]¶
Report invalid the multi-tag properties in a HED string, e.g. required tags.
- Parameters:
hed_string_obj (HedString) – A HedString object.
- Returns:
The issues associated with the tags in the HED string. Each issue is a dictionary.
- Return type:
list
- GroupValidator.run_tag_level_validators(hed_string_obj)[source]¶
Report invalid groups at each level.
- Parameters:
hed_string_obj (HedString) – A HedString object.
- Returns:
Issues associated with each level in the HED string. Each issue is a dictionary.
- Return type:
list
Notes
This pertains to the top-level, all groups, and nested groups.