diff --git a/nwb_linkml/src/nwb_linkml/generators/pydantic.py b/nwb_linkml/src/nwb_linkml/generators/pydantic.py index 1675f1e..54c2342 100644 --- a/nwb_linkml/src/nwb_linkml/generators/pydantic.py +++ b/nwb_linkml/src/nwb_linkml/generators/pydantic.py @@ -328,7 +328,7 @@ class NWBPydanticGenerator(PydanticGenerator): if not self.split: # we are compiling this whole thing in one big file so we don't import anything return {} - if 'is_namespace' in sv.schema.annotations.keys() and sv.schema.annotations['is_namespace']['value'] == 'True': + if 'is_namespace' in sv.schema.annotations.keys() and sv.schema.annotations['is_namespace']['value'] in ('True', True): return self._get_namespace_imports(sv) all_classes = sv.all_classes(imports=True) diff --git a/nwb_linkml/src/nwb_linkml/providers/schema.py b/nwb_linkml/src/nwb_linkml/providers/schema.py index ca553fb..02637d8 100644 --- a/nwb_linkml/src/nwb_linkml/providers/schema.py +++ b/nwb_linkml/src/nwb_linkml/providers/schema.py @@ -703,7 +703,7 @@ class PydanticProvider(Provider): def get(self, namespace: str, version: Optional[str] = None, - allow_repo: bool = True) -> ModuleType: + allow_repo: Optional[bool] = None) -> ModuleType: """ Get the imported module for a given namespace and version. @@ -735,6 +735,8 @@ class PydanticProvider(Provider): The imported :class:`types.ModuleType` object that has all the built classes at the root level. """ + if allow_repo is None: + allow_repo = self.allow_repo if version is None: version = self.available_versions[namespace][-1] diff --git a/nwb_linkml/tests/test_linkml.py b/nwb_linkml/tests/test_linkml.py deleted file mode 100644 index c9e3634..0000000 --- a/nwb_linkml/tests/test_linkml.py +++ /dev/null @@ -1,15 +0,0 @@ -import pytest -import warnings - -def test_hold_up(): - from linkml_runtime.linkml_model import SchemaDefinition, Annotation - schema = SchemaDefinition( - id='myschema', - name='myschema', - annotations=[{'tag':'my_annotation','value':True}] - ) - - warnings.warn('TYPE OF ANNOTATION IS') - warnings.warn(str(type(schema.annotations['my_annotation'].value))) - -