HedTagCounts

class HedTagCounts(name, total_events=0)[source]

Counts of HED tags for a group of columnar files.

Parameters:
  • name (str) – An identifier for these counts (usually the filename of the tabular file).

  • total_events (int) – The total number of events in the columnar file.

Methods

HedTagCounts.__init__(name[, total_events])

HedTagCounts.create_template(tags)

Creates a dictionary with keys based on list of keys in tags dictionary.

HedTagCounts.get_summary()

Return a summary object containing the tag count information of this summary.

HedTagCounts.merge_tag_dicts(other_dict)

Merge the information from another dictionary with this object's tag dictionary.

HedTagCounts.organize_tags(tag_template)

Organize tags into categories as specified by the tag_template.

HedTagCounts.update_tag_counts(...)

Update the tag counts based on a HedString object.

Attributes

HedTagCounts.__init__(name, total_events=0)[source]
static HedTagCounts.create_template(tags)[source]

Creates a dictionary with keys based on list of keys in tags dictionary.

Parameters:

tags (dict) – dictionary of tags and key lists.

Returns:

Dictionary with keys in key lists and values are empty lists.

Return type:

dict

Note: This class is used to organize the results of the tags based on a template for display.

HedTagCounts.get_summary()[source]

Return a summary object containing the tag count information of this summary.

Returns:

Keys are ‘name’, ‘files’, ‘total_events’, and ‘details’.

Return type:

dict

HedTagCounts.merge_tag_dicts(other_dict)[source]

Merge the information from another dictionary with this object’s tag dictionary.

Parameters:

other_dict (dict) – Dictionary of tag, HedTagCount to merge.

HedTagCounts.organize_tags(tag_template)[source]

Organize tags into categories as specified by the tag_template.

Parameters:

tag_template (dict) – A dictionary whose keys are titles and values are lists of HED tags (str).

Returns:

Keys are tags (strings) and values are list of HedTagCount for items fitting template. list: HedTagCount objects corresponding to tags that don’t fit the template.

Return type:

dict

HedTagCounts.update_tag_counts(hed_string_obj, file_name)[source]

Update the tag counts based on a HedString object.

Parameters:
  • hed_string_obj (HedString) – The HED string whose tags should be counted.

  • file_name (str) – The name of the file corresponding to these counts.