SummarizeSidecarFromEventsOp

class SummarizeSidecarFromEventsOp(parameters)[source]

Create a JSON sidecar from column values in a collection of tabular files.

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

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

Optional remodeling parameters:
  • append_timecode (bool):

  • skip_columns (list): Names of columns to skip in the summary.

  • value_columns (list): Names of columns to treat as value columns rather than categorical columns.

The purpose is to produce a JSON sidecar template for annotating a dataset with HED tags.

Methods

SummarizeSidecarFromEventsOp.__init__(parameters)

Constructor for summarize sidecar from events operation.

SummarizeSidecarFromEventsOp.do_op(...[, ...])

Extract a sidecar from events file.

SummarizeSidecarFromEventsOp.validate_input_data(...)

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

Attributes

SummarizeSidecarFromEventsOp.NAME

SummarizeSidecarFromEventsOp.PARAMS

SummarizeSidecarFromEventsOp.SUMMARY_TYPE

SummarizeSidecarFromEventsOp.__init__(parameters)[source]

Constructor for summarize sidecar from events operation.

Parameters:

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

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

Extract a sidecar from events file.

Parameters:
  • dispatcher (Dispatcher) – The dispatcher object for managing the operations.

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

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

  • sidecar (Sidecar or file-like) – Not needed for this operation.

Returns:

A copy of df.

Return type:

DataFrame

Side effect:

Updates the associated summary if applicable.

static SummarizeSidecarFromEventsOp.validate_input_data(parameters)[source]

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

SummarizeSidecarFromEventsOp.NAME = 'summarize_sidecar_from_events'
SummarizeSidecarFromEventsOp.PARAMS = {'additionalProperties': False, 'properties': {'append_timecode': {'type': 'boolean'}, 'skip_columns': {'description': 'List of columns to skip in generating the sidecar.', 'items': {'type': 'string'}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}, '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'}, 'value_columns': {'description': 'List of columns to provide a single annotation with placeholder for the values.', 'items': {'type': 'string'}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}}, 'required': ['summary_name', 'summary_filename'], 'type': 'object'}
SummarizeSidecarFromEventsOp.SUMMARY_TYPE = 'events_to_sidecar'