DefExpandGatherer

class DefExpandGatherer(hed_schema, known_defs=None, ambiguous_defs=None, errors=None)[source]

Class for gathering definitions from a series of def-expands, including possibly ambiguous ones

Methods

hed.models.def_expand_gather.DefExpandGatherer.__init__(...)

Initialize the DefExpandGatherer class.

hed.models.def_expand_gather.DefExpandGatherer.get_ambiguous_group(...)

Turns an entry in the ambiguous_defs dict into a single HedGroup

hed.models.def_expand_gather.DefExpandGatherer.process_def_expands(...)

Process the HED strings containing def-expand tags.

Attributes

DefExpandGatherer.__init__(hed_schema, known_defs=None, ambiguous_defs=None, errors=None)[source]

Initialize the DefExpandGatherer class.

Parameters:
  • hed_schema (HedSchema) – The HED schema to be used for processing.

  • known_defs (dict, optional) – A dictionary of known definitions.

  • ambiguous_defs (dict, optional) – A dictionary of ambiguous def-expand definitions.

static DefExpandGatherer.get_ambiguous_group(ambiguous_def)[source]

Turns an entry in the ambiguous_defs dict into a single HedGroup

Returns:

the ambiguous definition with known placeholders filled in

Return type:

HedGroup

DefExpandGatherer.process_def_expands(hed_strings, known_defs=None)[source]

Process the HED strings containing def-expand tags.

Parameters:
  • hed_strings (pd.Series or list) – A Pandas Series or list of HED strings to be processed.

  • known_defs (dict, optional) – A dictionary of known definitions to be added.

Returns:

A tuple containing the DefinitionDict, ambiguous definitions, and errors.

Return type:

tuple