Skip to content

Commit

Permalink
in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaylon1 committed Mar 19, 2024
1 parent 6131fdb commit 4f617cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/hdmf/build/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .builders import DatasetBuilder, GroupBuilder, LinkBuilder, Builder, BaseBuilder
from .classgenerator import ClassGenerator, CustomClassGenerator, MCIClassGenerator
from ..container import AbstractContainer, Container, Data
from ..common import get_type_map()
from ..term_set import TermSetConfigurator
from ..spec import DatasetSpec, GroupSpec, NamespaceCatalog
from ..spec.spec import BaseStorageSpec
Expand Down Expand Up @@ -734,6 +735,7 @@ def register_container_type(self, **kwargs):
self.__container_types.setdefault(namespace, dict())
self.__container_types[namespace][data_type] = container_cls
self.__data_types.setdefault(container_cls, (namespace, data_type))
container_cls.__type_map = get_type_map()
if not isinstance(container_cls, TypeSource):
setattr(container_cls, spec.type_key(), data_type)
setattr(container_cls, 'namespace', namespace)
Expand Down
11 changes: 7 additions & 4 deletions src/hdmf/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ def register_class(**kwargs):
def _dec(cls):
_set_exp(cls)
__TYPE_MAP.register_container_type(namespace, data_type, cls)
cls.type_map = __TYPE_MAP
cls.namespace = namespace
# cls.type_map = __TYPE_MAP
# cls.namespace = namespace
return cls
else:
def _dec(cls):
__TYPE_MAP.register_container_type(namespace, data_type, cls)
cls.type_map = __TYPE_MAP
cls.namespace = namespace
# cls.type_map = __TYPE_MAP
# cls.namespace = namespace
return cls

if container_cls is None:
Expand Down Expand Up @@ -183,6 +183,9 @@ def get_type_map(**kwargs):
type_map.load_namespaces(extensions)
elif isinstance(extensions, TypeMap):
type_map.merge(extensions)
global_config = __TYPE_MAP.ts_config
if global_config is not None:
type_map.ts_config = global_config
return type_map


Expand Down

0 comments on commit 4f617cb

Please sign in to comment.