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
|
|
Creates a dictionary with keys based on list of keys in tags dictionary. |
|
Return a summary object containing the tag count information of this summary. |
|
|
Merge the information from another dictionary with this object's tag dictionary. |
|
Organize tags into categories as specified by the tag_template. |
Update the tag counts based on a HedString object. |
Attributes
- 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