Skip to content

Update default type map to None for TypeMap generation - #663

Merged
rly merged 5 commits into
devfrom
rly-patch-1
May 7, 2026
Merged

Update default type map to None for TypeMap generation#663
rly merged 5 commits into
devfrom
rly-patch-1

Conversation

@rly

@rly rly commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

Changed the default type map to None for a clean TypeMap generation.

Summary of changes

Checklist

For all schema changes:

  • Add release notes for the PR to docs/format/source/format_release_notes.rst.
  • Have you included the relevant issue number using "Fix #XXX" notation where XXX is the issue number? By including "Fix #XXX" you allow GitHub to close issue #XXX when the PR is merged.
  • Make sure that hdmf-common-schema points to the latest release and not the latest commit on the main branch.

If this is the first schema change after a schema release (i.e., the version string in core/nwb.namespace.yaml does not
end in "-alpha"), then:

  • Update the version string in core/nwb.namespace.yaml and core/nwb.file.yaml to the next major/minor/patch
    version 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".
  • Update the value of the version variable in docs/format/source/conf.py to the next version without the
    suffix "-alpha", e.g., "2.5.0".
  • Update the value of the release variable in docs/format/source/conf.py to the next version with the suffix
    "-alpha", e.g., "2.5.0-alpha".
  • Add a new section in the release notes docs/format/source/format_release_notes.rst for the new version
    with the date "Upcoming" in parentheses.

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
rly marked this pull request as ready for review May 6, 2026 21:33
@rly
rly enabled auto-merge (squash) May 6, 2026 21:34
@rly
rly requested a review from oruebel May 6, 2026 23:09

@oruebel oruebel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'))

@rly

rly commented May 7, 2026

Copy link
Copy Markdown
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>
@rly rly mentioned this pull request May 7, 2026
10 tasks
@rly
rly requested a review from oruebel May 7, 2026 17:14
@rly
rly merged commit 4e23269 into dev May 7, 2026
3 checks passed
@rly
rly deleted the rly-patch-1 branch May 7, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Schema documentation does not reflect the latest version

2 participants