EventManager¶
- class EventManager(input_data, hed_schema, extra_defs=None)[source]
Methods
Create an event manager for an events file. |
|
|
|
|
Return a list of definition names (lower case) that correspond to one of the specified types. |
|
Create a HedString object from a list of strings. |
|
Unfolds the event information into hed, base, and contexts either as arrays of str or of HedString. |
Attributes
- EventManager.__init__(input_data, hed_schema, extra_defs=None)[source]¶
Create an event manager for an events file. Manages events of temporal extent.
- Parameters:
input_data (TabularInput) – Represents an events file with its sidecar.
hed_schema (HedSchema) – HED schema used in this
extra_defs (DefinitionDict) – Extra definitions not included in the input_data information.
- Raises:
if there are any unmatched offsets.
Notes: Keeps the events of temporal extend by their starting index in events file. These events are separated from the rest of the annotations.
- EventManager.get_type_defs(types)[source]¶
Return a list of definition names (lower case) that correspond to one of the specified types.
- Parameters:
types (list) – List of tags that are treated as types such as ‘Condition-variable’
- Returns:
List of definition names (lower-case) that correspond to the specified types
- Return type:
list
- EventManager.str_list_to_hed(str_list)[source]¶
Create a HedString object from a list of strings.
- Parameters:
str_list (list) – A list of strings to be concatenated with commas and then converted.
- Returns:
The converted list.
- Return type:
HedString or None
- EventManager.unfold_context(remove_types=[])[source]¶
Unfolds the event information into hed, base, and contexts either as arrays of str or of HedString.
- Parameters:
remove_types (list) – List of types to remove.
- Returns:
list of str or HedString representing the information without the events of temporal extent list of str or HedString representing the onsets of the events of temporal extent list of str or HedString representing the ongoing context information.