Skip to content

Commit

Permalink
not sure clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaylon1 committed Aug 1, 2024
1 parent 6caa774 commit f00b134
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
27 changes: 1 addition & 26 deletions src/pynwb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,33 +77,8 @@ def _get_resources():
global __TYPE_MAP

__NS_CATALOG = NamespaceCatalog(NWBGroupSpec, NWBDatasetSpec, NWBNamespace)

class NWBTypeMap(TypeMap):
def __init__(self, **kwargs):
super().__init__(**kwargs)

def __copy__(self):
ret = NWBTypeMap(namespaces=copy(self._TypeMap__ns_catalog),
mapper_cls=self._TypeMap__default_mapper_cls,
type_config=self.type_config)
ret.merge(self)
return ret

def modify_builder(self, builder):
try:
ndtype = builder['neurodata_type']
except KeyError:
ndtype = 'Not Group'
# remap ElectrodesTable from a DynamicTable named electrodes
if ndtype == 'DynamicTable' and builder.name == 'electrodes':
builder.set_attribute(name='namespace', value='core')
builder.set_attribute(name='neurodata_type', value='ElectrodesTable')
return builder
else:
return None

hdmf_typemap = hdmf.common.get_type_map()
__TYPE_MAP = NWBTypeMap(namespaces=__NS_CATALOG)
__TYPE_MAP = TypeMap(namespaces=__NS_CATALOG)
__TYPE_MAP.merge(hdmf_typemap, ns_catalog=True)

@docval({'name': 'extensions', 'type': (str, TypeMap, list),
Expand Down
2 changes: 1 addition & 1 deletion src/pynwb/nwb-schema

0 comments on commit f00b134

Please sign in to comment.