From f10553a8dd38a6e90984886c12dd4b1bba1781d4 Mon Sep 17 00:00:00 2001 From: Kay Robbins <1189050+VisLab@users.noreply.github.com> Date: Fri, 28 Apr 2023 17:10:20 -0500 Subject: [PATCH] Updated the imports for df_util --- hed/models/df_util.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hed/models/df_util.py b/hed/models/df_util.py index 8d00d6770..32311abf6 100644 --- a/hed/models/df_util.py +++ b/hed/models/df_util.py @@ -3,9 +3,8 @@ from hed.models.sidecar import Sidecar from hed.models.tabular_input import TabularInput -from hed import HedString +from hed.models.hed_string import HedString from hed.models.definition_dict import DefinitionDict -from hed.models.definition_entry import DefinitionEntry def get_assembled(tabular_file, sidecar, hed_schema, extra_def_dicts=None, join_columns=True, @@ -29,7 +28,7 @@ def get_assembled(tabular_file, sidecar, hed_schema, extra_def_dicts=None, join_ Expand any def tags found Returns: tuple: A list of HedStrings or a list of lists of HedStrings, DefinitionDict - + """ if isinstance(sidecar, str): sidecar = Sidecar(sidecar) @@ -52,7 +51,8 @@ def get_assembled(tabular_file, sidecar, hed_schema, extra_def_dicts=None, join_ return [[HedString(x, hed_schema, def_dict).expand_defs() if expand_defs else HedString(x, hed_schema, def_dict).shrink_defs() if shrink_defs else HedString(x, hed_schema, def_dict) - for x in text_file_row] for text_file_row in tabular_file.dataframe_a.itertuples(index=False)], def_dict + for x in text_file_row] for text_file_row in tabular_file.dataframe_a.itertuples(index=False)], \ + def_dict def convert_to_form(df, hed_schema, tag_form, columns=None): @@ -139,6 +139,7 @@ def _expand_defs(hed_string, hed_schema, def_dict): from hed import HedString return str(HedString(hed_string, hed_schema, def_dict).expand_defs()) + def _get_matching_value(tags): # Filter out values equal to "#" and get unique values unique_values = set(tag.extension for tag in tags if tag.extension != "#") @@ -166,4 +167,4 @@ def process_def_expands(hed_strings, hed_schema, known_defs=None, ambiguous_defs """ from hed.models.def_expand_gather import DefExpandGatherer def_gatherer = DefExpandGatherer(hed_schema, known_defs, ambiguous_defs) - return def_gatherer.process_def_expands(hed_strings) \ No newline at end of file + return def_gatherer.process_def_expands(hed_strings)