Skip to content

Use new get_namespace_for_type method in schematype_to_aqnwb #226

@oruebel

Description

@oruebel

#224 add this code:

# Determine the actual namespace this type belongs to
# Check if this type comes from an included namespace
type_namespace = namespace.name # Default to current namespace
# Look through all namespaces in the catalog to find the original namespace
for ns_name in type_map.namespace_catalog.namespaces:
ns = type_map.namespace_catalog.get_namespace(ns_name)
if ns != namespace and spec_name in ns.catalog.get_registered_types():
# This type is originally from a different namespace
type_namespace = ns_name
break
type_to_namespace_map[spec.neurodata_type_def] = type_namespace

A get_namespace_for_type method will be added to the namespace catalog in https://github.com/hdmf-dev/hdmf/pull/1312/files#diff-0458c07608cd941f7b8f1cfa52c52faa016b6c2a17e913e820a2a5108609776dR336 which should behave similarly to this section. We should check if the code can be replaced to use this new method in HDMF instead.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions