EventManager

class EventManager(input_data, hed_schema, extra_defs=None)[source]

Methods

hed.tools.analysis.event_manager.EventManager.__init__(...)

Create an event manager for an events file.

hed.tools.analysis.event_manager.EventManager.compress_strings(...)

hed.tools.analysis.event_manager.EventManager.get_type_defs(types)

Return a list of definition names (lower case) that correspond to one of the specified types.

hed.tools.analysis.event_manager.EventManager.str_list_to_hed(...)

Create a HedString object from a list of strings.

hed.tools.analysis.event_manager.EventManager.unfold_context([...])

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:

HedFileError

  • 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.

static EventManager.compress_strings(list_to_compress)[source]
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.