diff --git a/hed/__init__.py b/hed/__init__.py index e2bdcd053..e9026996d 100644 --- a/hed/__init__.py +++ b/hed/__init__.py @@ -12,7 +12,7 @@ from hed.schema.hed_schema import HedSchema from hed.schema.hed_schema_group import HedSchemaGroup -from hed.schema.hed_schema_io import get_schema, get_schema_versions, load_schema, load_schema_version +from hed.schema.hed_schema_io import get_schema, load_schema, load_schema_version # from hed import errors, models, schema, tools, validator diff --git a/hed/schema/__init__.py b/hed/schema/__init__.py index 01c9ef1d5..5db24d5ea 100644 --- a/hed/schema/__init__.py +++ b/hed/schema/__init__.py @@ -3,8 +3,7 @@ from .hed_schema_entry import HedSchemaEntry, UnitClassEntry, UnitEntry, HedTagEntry from .hed_schema_group import HedSchemaGroup from .hed_schema_section import HedSchemaSection -from .hed_schema_io import load_schema, load_schema_version, from_string, get_hed_xml_version, get_schema, \ - get_schema_versions +from .hed_schema_io import load_schema, load_schema_version, from_string, get_hed_xml_version, get_schema from .hed_schema_constants import HedKey, HedSectionKey from .hed_cache import cache_xml_versions, get_hed_versions, \ get_path_from_hed_version, set_cache_directory, get_cache_directory diff --git a/hed/schema/hed_schema_io.py b/hed/schema/hed_schema_io.py index f26ee7c6e..fdfdf9775 100644 --- a/hed/schema/hed_schema_io.py +++ b/hed/schema/hed_schema_io.py @@ -58,17 +58,6 @@ def get_schema(hed_versions): raise ValueError("InvalidHedSchemaOrSchemaVersion", "Expected schema or schema version") -def get_schema_versions(hed_schema, as_string=True): - if not hed_schema and as_string: - return '' - elif not hed_schema: - return None - elif isinstance(hed_schema, HedSchema) or isinstance(hed_schema, HedSchemaGroup): - return hed_schema.get_formatted_version(as_string=as_string) - else: - raise ValueError("InvalidHedSchemaOrHedSchemaGroup", "Expected schema or schema group") - - def load_schema(hed_path=None, schema_namespace=None): """ Load a schema from the given file or URL path. diff --git a/hed/tools/remodeling/operations/summarize_definitions_op.py b/hed/tools/remodeling/operations/summarize_definitions_op.py index 43a104e09..4e9407969 100644 --- a/hed/tools/remodeling/operations/summarize_definitions_op.py +++ b/hed/tools/remodeling/operations/summarize_definitions_op.py @@ -1,4 +1,4 @@ -""" Summarize the values in the columns of a tabular file. """ +""" Summarize the definitions in the dataset. """ from hed import TabularInput from hed.tools.remodeling.operations.base_op import BaseOp @@ -7,7 +7,7 @@ class SummarizeDefinitionsOp(BaseOp): - """ Summarize the definitions in the columns of a tabular file. + """ Summarize the definitions in the dataset. Required remodeling parameters: - **summary_name** (*str*): The name of the summary. @@ -102,11 +102,10 @@ def _build_summary_dict(items_dict, title, process_func, display_description=Fal if display_description: description, value = DefinitionSummary._remove_description(value) items[key] = {"description": description, "contents": str(value)} + elif isinstance(value, list): + items[key] = [str(x) for x in value] else: - if isinstance(value, list): - items[key] = [str(x) for x in value] - else: - items[key] = str(value) + items[key] = str(value) summary_dict[title] = items return summary_dict diff --git a/tests/tools/remodeling/operations/test_summarize_definitions_op.py b/tests/tools/remodeling/operations/test_summarize_definitions_op.py index c01e949be..e829c2739 100644 --- a/tests/tools/remodeling/operations/test_summarize_definitions_op.py +++ b/tests/tools/remodeling/operations/test_summarize_definitions_op.py @@ -78,7 +78,8 @@ def test_summary_errors(self): df_new = sum_op.do_op(dispatch, dispatch.prep_data(df), 'subj2_run1', sidecar=self.json_path) self.assertIn(sum_op.summary_name, dispatch.summary_dicts) self.assertIsInstance(dispatch.summary_dicts[sum_op.summary_name], DefinitionSummary) - #print(str(dispatch.summary_dicts[sum_op.summary_name].get_text_summary()['Dataset'])) + # print(str(dispatch.summary_dicts[sum_op.summary_name].get_text_summary()['Dataset'])) + if __name__ == '__main__': unittest.main()