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:
  • expand_context (bool): If True, include counts from expanded context (not supported).

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

Methods

hed.tools.remodeling.operations.summarize_hed_tags_op.SummarizeHedTagsOp.__init__(...)

Constructor for the summarize_hed_tags operation.

hed.tools.remodeling.operations.summarize_hed_tags_op.SummarizeHedTagsOp.check_parameters(...)

Verify that the parameters meet the operation specification.

hed.tools.remodeling.operations.summarize_hed_tags_op.SummarizeHedTagsOp.do_op(...)

Summarize the HED tags present in the dataset.

Attributes

hed.tools.remodeling.operations.summarize_hed_tags_op.SummarizeHedTagsOp.PARAMS

hed.tools.remodeling.operations.summarize_hed_tags_op.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.

Raises:
  • KeyError

    • If a required parameter is missing.

    • If an unexpected parameter is provided.

  • TypeError

    • If a parameter has the wrong type.

SummarizeHedTagsOp.check_parameters(parameters)

Verify that the parameters meet the operation specification.

Parameters:

parameters (dict) – Dictionary of parameters for this operation.

Raises:
  • KeyError

    • If a required parameter is missing.

    • If an unexpected parameter is provided.

  • TypeError

    • If a parameter has the wrong type.

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.

SummarizeHedTagsOp.PARAMS = {'operation': 'summarize_hed_tags', 'optional_parameters': {'append_timecode': <class 'bool'>, 'include_context': <class 'bool'>, 'remove_types': <class 'list'>, 'replace_defs': <class 'bool'>}, 'required_parameters': {'summary_filename': <class 'str'>, 'summary_name': <class 'str'>, 'tags': <class 'dict'>}}
SummarizeHedTagsOp.SUMMARY_TYPE = 'hed_tag_summary'