SummarizeHedTagsOp

class SummarizeHedTagsOp(parameters)[source]

Summarize the HED tags in collection of tabular files.

Required remodeling parameters:
  • summary_name (str): The name of the summary.

  • summary_filename (str): Base filename of the summary.

  • tags (dict): Specifies how to organize the tag output.

Optional remodeling parameters:
  • append_timecode (bool): If True, the timecode is appended to the base filename when summary is saved.

  • include_context (bool): If True, context of events is included in summary.

  • remove_types (list): A list of type tags such as Condition-variable or Task to exclude from summary.

  • replace_defs (bool): If True, the def tag is replaced by the contents of the definitions.

  • word_cloud (bool): If True, output a word cloud visualization.

The purpose of this op is to produce a summary of the occurrences of HED tags organized in a specified manner.

Notes: The tags template is a dictionary whose keys are the organization titles (not necessarily tags) for the output and whose values are the tags, which if they or their children appear, they will be listed under that title.

Methods

SummarizeHedTagsOp.__init__(parameters)

Constructor for the summarize_hed_tags operation.

SummarizeHedTagsOp.do_op(dispatcher, df, name)

Summarize the HED tags present in the dataset.

SummarizeHedTagsOp.validate_input_data(...)

Additional validation required of operation parameters not performed by JSON schema validator.

Attributes

SummarizeHedTagsOp.NAME

SummarizeHedTagsOp.PARAMS

SummarizeHedTagsOp.SUMMARY_TYPE

SummarizeHedTagsOp.__init__(parameters)[source]

Constructor for the summarize_hed_tags operation.

Parameters:

parameters (dict) – Dictionary with the parameter values for required and optional parameters.

SummarizeHedTagsOp.do_op(dispatcher, df, name, sidecar=None)[source]

Summarize the HED tags present in the dataset.

Parameters:
  • dispatcher (Dispatcher) – Manages the operation I/O.

  • df (DataFrame) – The DataFrame to be remodeled.

  • name (str) – Unique identifier for the dataframe – often the original file path.

  • sidecar (Sidecar or file-like) – Only needed for HED operations.

Returns:

A copy of df.

Return type:

DataFrame

Side effect:

Updates the context.

static SummarizeHedTagsOp.validate_input_data(parameters)[source]

Additional validation required of operation parameters not performed by JSON schema validator.

SummarizeHedTagsOp.NAME = 'summarize_hed_tags'
SummarizeHedTagsOp.PARAMS = {'additionalProperties': False, 'properties': {'append_timecode': {'description': 'If true, the timecode is appended to the base filename so each run has a unique name.', 'type': 'boolean'}, 'include_context': {'description': 'If true, tags for events that unfold over time are counted at each intermediate time.', 'type': 'boolean'}, 'remove_types': {'description': 'A list of special tags such as Condition-variable whose influence is to be removed.', 'items': {'type': 'string'}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}, 'replace_defs': {'description': 'If true, then the Def tags are replaced with actual definitions for the count.', 'type': 'boolean'}, 'summary_filename': {'description': 'Name to use for the summary file name base.', 'type': 'string'}, 'summary_name': {'description': 'Name to use for the summary in titles.', 'type': 'string'}, 'tags': {'description': 'A dictionary with the template for how output of tags should be organized.', 'patternProperties': {'.*': {'items': {'type': 'string'}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}, 'additionalProperties': False, 'minProperties': 1}, 'type': 'object'}, 'word_cloud': {'additionalProperties': False, 'properties': {'background_color': {'description': 'Name of the background color (uses MatPlotLib names for colors).', 'type': 'string'}, 'contour_color': {'description': 'Name of the contour color (uses MatPlotLib names for colors).', 'type': 'string'}, 'contour_width': {'description': 'Width in pixels of contour surrounding the words.', 'type': 'number'}, 'font_path': {'description': 'Path to system font to use for word cloud display (system-specific).', 'type': 'string'}, 'height': {'description': 'Height of word cloud image in pixels.', 'type': 'integer'}, 'mask_path': {'description': 'Path of the mask image used to surround the words.', 'type': 'string'}, 'max_font_size': {'description': 'Maximum font size in point for the word cloud words.', 'type': 'number'}, 'min_font_size': {'description': 'Minimum font size in points for the word cloud words.', 'type': 'number'}, 'prefer_horizontal': {'description': 'Fraction of the words that are oriented horizontally.', 'type': 'number'}, 'scale_adjustment': {'description': 'Constant to add to log-transformed frequencies of the words to get scale.', 'type': 'number'}, 'set_font': {'description': 'If true, set the font to a system font (provided by font_path).', 'type': 'boolean'}, 'use_mask': {'description': 'If true then confine the word display to region within the provided mask.', 'type': 'boolean'}, 'width': {'description': 'Width of word cloud image in pixels.', 'type': 'integer'}}, 'type': 'object'}}, 'required': ['summary_name', 'summary_filename', 'tags'], 'type': 'object'}
SummarizeHedTagsOp.SUMMARY_TYPE = 'hed_tag_summary'