Repository: hed-standard/hed-python (language: python)

Issue:
Merging web-work to make bids_dataset validation available



Discussion / hints:

Fix patch:
diff --git a/hedtools/hed/tools/bids/bids_dataset.py b/hedtools/hed/tools/bids/bids_dataset.py
index c01f88c76..fc03b3e5a 100644
--- a/hedtools/hed/tools/bids/bids_dataset.py
+++ b/hedtools/hed/tools/bids/bids_dataset.py
@@ -8,7 +8,7 @@
 from hed.validator import HedValidator
 
 
-LIBRARY_URL_BASE = "https://raw.githubusercontent.com/hed-standard/hed-schema-library/main/hedxml/HED_"
+LIBRARY_URL_BASE = "https://raw.githubusercontent.com/hed-standard/hed-schema-library/main/hedxml/"
 
 
 class BidsDataset:
@@ -39,7 +39,8 @@ def _schema_from_description(self):
             hed_list.append(load_schema_version(xml_version_number=hed['base']))
         if 'libraries' in hed:
             for key, library in hed['libraries'].items():
-                url = LIBRARY_URL_BASE + library + '.xml'
+                library_pieces = library.split('_')
+                url = LIBRARY_URL_BASE + library_pieces[0] + '/HED_' + library + '.xml'
                 x = load_schema(url, library_prefix=key)
                 x.set_library_prefix(key)  # TODO: temporary work around
                 hed_list.append(x)
@@ -51,7 +52,6 @@ def get_summary(self):
 
     def get_schema_versions(self):
         version_list = []
-        x = self.schemas
         for prefix, schema in self.schemas._schemas.items():
             name = schema.version
             if schema.library:
diff --git a/webtools/hedweb/sidecar.py b/webtools/hedweb/sidecar.py
index 04646ef3f..7d0206a50 100644
--- a/webtools/hedweb/sidecar.py
+++ b/webtools/hedweb/sidecar.py
@@ -8,6 +8,7 @@
 from hed.validator.hed_validator import HedValidator
 from hed.errors.error_reporter import get_printable_issue_string
 from hed.errors.exceptions import HedFileError
+from hed.models.hed_string import HedString
 from hedweb.constants import base_constants, file_constants
 from hed.util.io_util import generate_filename
 from hed.tools.sidecar_map import SidecarMap
@@ -104,7 +105,8 @@ def sidecar_convert(hed_schema, json_sidecar, command=base_constants.COMMAND_TO_
     else:
         tag_form = 'short_tag'
     issues = []
-    for hed_string_obj, position_info, issue_items in json_sidecar.hed_string_iter(validators=hed_schema,
+    ops = hed_schema
+    for hed_string_obj, position_info, issue_items in json_sidecar.hed_string_iter(validators=ops,
                                                                                    expand_defs=expand_defs):
         converted_string = hed_string_obj.get_as_form(tag_form)
         issues = issues + issue_items


Test patch:
diff --git a/hedtools/tests/schema_cache_test/last_update.txt b/hedtools/tests/schema_cache_test/last_update.txt
index f0bc262f5..b7e58b084 100644
--- a/hedtools/tests/schema_cache_test/last_update.txt
+++ b/hedtools/tests/schema_cache_test/last_update.txt
@@ -1,1 +1,1 @@
-1642695314.9813824
\ No newline at end of file
+1642720677.119382
\ No newline at end of file