MCPcopy Index your code
hub / github.com/mne-tools/mne-python / _validate_hed_string

Method _validate_hed_string

mne/annotations.py:969–979  ·  view source on GitHub ↗
(self, value, schema)

Source from the content-addressed store, hash-verified

967 self._objs[key] = hs
968
969 def _validate_hed_string(self, value, schema):
970 # create HedString object and validate it
971 hs = self._hed.HedString(value, schema)
972 # handle any errors
973 error_handler = self._hed.errors.ErrorHandler(check_for_warnings=False)
974 issues = hs.validate(allow_placeholders=False, error_handler=error_handler)
975 error_string = self._hed.get_printable_issue_string(issues)
976 if len(error_string):
977 raise ValueError(f"A HED string failed to validate:\n {error_string}")
978 hs.sort()
979 return hs
980
981 def append(self, item):
982 """Append an item to the end of the HEDString list."""

Callers 5

__init__Method · 0.95
__setitem__Method · 0.95
appendMethod · 0.95
__eq__Method · 0.80
appendMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected