Skip to content
Merged
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
6 changes: 4 additions & 2 deletions hed/models/hed_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(self, hed_string, hed_schema, def_dict=None, _contents=None):
super().__init__(hed_string, contents=contents, startpos=0, endpos=len(hed_string))
self._schema = hed_schema
self._from_strings = None
self._def_dict = def_dict

@classmethod
def from_hed_strings(cls, hed_strings):
Expand All @@ -55,7 +56,8 @@ def from_hed_strings(cls, hed_strings):
hed_string = ",".join([group._hed_string for group in hed_strings])
contents = [child for sub_string in hed_strings for child in sub_string.children]
first_schema = hed_strings[0]._schema
new_string.__init__(hed_string=hed_string, _contents=contents, hed_schema=first_schema)
first_dict = hed_strings[0]._def_dict
new_string.__init__(hed_string=hed_string, _contents=contents, hed_schema=first_schema, def_dict=first_dict)
new_string._from_strings = hed_strings
return new_string

Expand Down Expand Up @@ -344,7 +346,7 @@ def validate(self, allow_placeholders=True, error_handler=None):
"""
from hed.validator import HedValidator

validator = HedValidator(self._schema)
validator = HedValidator(self._schema, def_dicts=self._def_dict)
return validator.validate(self, allow_placeholders=allow_placeholders, error_handler=error_handler)

def find_top_level_tags(self, anchor_tags, include_groups=2):
Expand Down