Update default type map to None for TypeMap generation - #663
Merged
Conversation
Changed the default type map to None for a clean TypeMap generation.
Explain why None is used: forces hdmf-docutils to build a fresh NamespaceCatalog from this repo's YAML, avoiding stale-version conflicts when pynwb has an older core namespace already loaded. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
rly
marked this pull request as ready for review
May 6, 2026 21:33
rly
enabled auto-merge (squash)
May 6, 2026 21:34
oruebel
requested changes
May 7, 2026
oruebel
left a comment
Contributor
There was a problem hiding this comment.
Docs build shows the below error. Other recent builds are passing, so I think this is related to the change here.
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/nwb-schema/envs/663/lib/python3.12/site-packages/sphinx/events.py", line 441, in emit
results.append(listener.handler(self._app, *args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/nwb-schema/checkouts/663/docs/format/source/conf.py", line 35, in run_doc_autogen
generate_docs()
File "/home/docs/checkouts/readthedocs.org/user_builds/nwb-schema/envs/663/lib/python3.12/site-packages/hdmf_docutils/generate_format_docs.py", line 461, in main
namespace_catalog = load_namespace(namespace_file=core_namespace_file,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/nwb-schema/envs/663/lib/python3.12/site-packages/hdmf_docutils/generate_format_docs.py", line 121, in load_namespace
namespace_catalog = NamespaceCatalog(default_namespace,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/nwb-schema/envs/663/lib/python3.12/site-packages/hdmf/utils.py", line 591, in func_call
pargs = _check_args(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/nwb-schema/envs/663/lib/python3.12/site-packages/hdmf/utils.py", line 584, in _check_args
raise ExceptionType(msg)
TypeError: NamespaceCatalog.__init__: incorrect type for 'core_namespaces' (got 'str', expected 'list')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/nwb-schema/envs/663/lib/python3.12/site-packages/sphinx/cmd/build.py", line 414, in build_main
app = Sphinx(
^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/nwb-schema/envs/663/lib/python3.12/site-packages/sphinx/application.py", line 340, in __init__
self._init_builder()
File "/home/docs/checkouts/readthedocs.org/user_builds/nwb-schema/envs/663/lib/python3.12/site-packages/sphinx/application.py", line 430, in _init_builder
self.events.emit('builder-inited')
File "/home/docs/checkouts/readthedocs.org/user_builds/nwb-schema/envs/663/lib/python3.12/site-packages/sphinx/events.py", line 452, in emit
raise ExtensionError(
sphinx.errors.ExtensionError: Handler <function run_doc_autogen at 0x748303c03b00> for event 'builder-inited' threw an exception (exception: NamespaceCatalog.__init__: incorrect type for 'core_namespaces' (got 'str', expected 'list'))
Contributor
Author
|
Sorry for the premature request for review. You're right. hdmf-dev/hdmf-docutils#95 and a release should fix it |
`spec_default_type_map = None` removed pynwb's stale `core` from the docs build (the original goal of #601), but it also dropped `hdmf-common`, which `core/nwb.namespace.yaml` declares as a dependency by name. The build then failed to resolve `hdmf-common` when loading `core`. Build a TypeMap with only `hdmf-common` pre-loaded from this checkout's submodule, so `core` is layered on fresh from this repo's YAML and resolves its dependency. Bump hdmf-docutils to >=0.4.10, which fixes the `default_type_map` code path that this config now exercises (hdmf-dev/hdmf-docutils#95). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
oruebel
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed the default type map to None for a clean TypeMap generation.
Summary of changes
Checklist
For all schema changes:
docs/format/source/format_release_notes.rst.hdmf-common-schemapoints to the latest release and not the latest commit on themainbranch.If this is the first schema change after a schema release (i.e., the version string in
core/nwb.namespace.yamldoes notend in "-alpha"), then:
core/nwb.namespace.yamlandcore/nwb.file.yamlto the next major/minor/patchversion with the suffix "-alpha". For example, if the current version is 2.4.0 and this is a minor change, then the
new version string should be "2.5.0-alpha".
versionvariable indocs/format/source/conf.pyto the next version without thesuffix "-alpha", e.g., "2.5.0".
releasevariable indocs/format/source/conf.pyto the next version with the suffix"-alpha", e.g., "2.5.0-alpha".
docs/format/source/format_release_notes.rstfor the new versionwith the date "Upcoming" in parentheses.