FactorHedTypeOp

class FactorHedTypeOp(parameters)[source]

Append to columnar file the factors computed from type variables.

Required remodeling parameters:
  • type_tag (str): HED tag used to find the factors (most commonly condition-variable).

Optional remodeling parameters:
  • type_values (list): If provided, specifies which factor values to include.

Methods

FactorHedTypeOp.__init__(parameters)

Constructor for the factor HED type operation.

FactorHedTypeOp.do_op(dispatcher, df, name)

Factor columns based on HED type and append to tabular data.

FactorHedTypeOp.validate_input_data(parameters)

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

Attributes

FactorHedTypeOp.NAME

FactorHedTypeOp.PARAMS

FactorHedTypeOp.__init__(parameters)[source]

Constructor for the factor HED type operation.

Parameters:

parameters (dict) – Actual values of the parameters for the operation.

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

Factor columns based on HED type and append to tabular data.

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 new DataFame with that includes the factors.

Return type:

DataFrame

Notes

  • If column_name is not a column in df, df is just returned.

static FactorHedTypeOp.validate_input_data(parameters)[source]

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

FactorHedTypeOp.NAME = 'factor_hed_type'
FactorHedTypeOp.PARAMS = {'additionalProperties': False, 'properties': {'type_tag': {'description': 'Type tag to use for computing factor vectors (e.g., Condition-variable or Task).', 'type': 'string'}, 'type_values': {'description': 'If provided, only compute one-hot factors for these values of the type tag.', 'items': {'type': 'string'}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}}, 'required': ['type_tag'], 'type': 'object'}