The default_type_map=None branch of load_namespace is broken — it calls NamespaceCatalog and reads attributes that don't exist on it.
Bugs
hdmf_docutils/generate_format_docs.py:121 does NamespaceCatalog(default_namespace, ...), but NamespaceCatalog.__init__'s signature is (group_spec_cls, dataset_spec_cls, spec_namespace_cls, core_namespaces=[]). Passing a str positionally fails docval type-checking with TypeError: NamespaceCatalog.__init__: incorrect type for 'core_namespaces' (got 'str', expected 'list').
hdmf_docutils/doctools/renderrst.py:331 accesses namespace_catalog.default_namespace, which is not an attribute of NamespaceCatalog.
NamespaceCatalog has never had a default_namespace parameter or attribute (verified back to 3.14.6), so these have always been broken. The bug went unnoticed because real callers always pass a non-None default_type_map, taking the other branch.
Trigger
Surfaces in NeurodataWithoutBorders/nwb-schema#663, which sets spec_default_type_map = None to avoid rendering docs against a stale core namespace bundled in pynwb. RTD build log: https://app.readthedocs.org/projects/nwb-schema/builds/32573738/.
Fix
- Drop the bogus first positional from the
NamespaceCatalog call; pass core_namespaces=[default_namespace] instead.
- Replace
namespace_catalog.default_namespace with namespace_catalog.core_namespaces[0] (with a clear error if empty).
The
default_type_map=Nonebranch ofload_namespaceis broken — it callsNamespaceCatalogand reads attributes that don't exist on it.Bugs
hdmf_docutils/generate_format_docs.py:121doesNamespaceCatalog(default_namespace, ...), butNamespaceCatalog.__init__'s signature is(group_spec_cls, dataset_spec_cls, spec_namespace_cls, core_namespaces=[]). Passing a str positionally fails docval type-checking withTypeError: NamespaceCatalog.__init__: incorrect type for 'core_namespaces' (got 'str', expected 'list').hdmf_docutils/doctools/renderrst.py:331accessesnamespace_catalog.default_namespace, which is not an attribute ofNamespaceCatalog.NamespaceCataloghas never had adefault_namespaceparameter or attribute (verified back to 3.14.6), so these have always been broken. The bug went unnoticed because real callers always pass a non-Nonedefault_type_map, taking the other branch.Trigger
Surfaces in NeurodataWithoutBorders/nwb-schema#663, which sets
spec_default_type_map = Noneto avoid rendering docs against a stalecorenamespace bundled in pynwb. RTD build log: https://app.readthedocs.org/projects/nwb-schema/builds/32573738/.Fix
NamespaceCatalogcall; passcore_namespaces=[default_namespace]instead.namespace_catalog.default_namespacewithnamespace_catalog.core_namespaces[0](with a clear error if empty).