Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions hed/schema/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 0 additions & 11 deletions hed/schema/hed_schema_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
11 changes: 5 additions & 6 deletions hed/tools/remodeling/operations/summarize_definitions_op.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()