Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error generating docs for LinkSpec without name #86

Closed
rly opened this issue Mar 31, 2024 · 0 comments · Fixed by #87
Closed

Error generating docs for LinkSpec without name #86

rly opened this issue Mar 31, 2024 · 0 comments · Fixed by #87
Assignees

Comments

@rly
Copy link
Contributor

rly commented Mar 31, 2024

A group spec in an extension has:

        links=[
            NWBLinkSpec(
                doc="The Subject object in the NWB file, if this Skeleton corresponds to the Subject.",
                target_type="Subject",
                quantity="?",
            ),
        ],

Running sphinx-build -b html -v -d build/doctrees source build/html results in:

Traceback (most recent call last):
  File "/Users/rly/mambaforge/envs/test/lib/python3.11/site-packages/sphinx/events.py", line 97, in emit
    results.append(listener.handler(self.app, *args))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rly/Documents/NWB/ndx-pose/docs/source/conf.py", line 73, in run_doc_autogen
    generate_docs()
  File "/Users/rly/mambaforge/envs/test/lib/python3.11/site-packages/hdmf_docutils/generate_format_docs.py", line 535, in main
    render_data_type_section(section=sec,
  File "/Users/rly/mambaforge/envs/test/lib/python3.11/site-packages/hdmf_docutils/generate_format_docs.py", line 334, in render_data_type_section
    rt_spec_data_table = SpecToRST.render_spec_table(
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rly/mambaforge/envs/test/lib/python3.11/site-packages/hdmf_docutils/doctools/renderrst.py", line 697, in render_spec_table
    SpecToRST.render_spec_table(spec=link,
  File "/Users/rly/mambaforge/envs/test/lib/python3.11/site-packages/hdmf_docutils/doctools/renderrst.py", line 644, in render_spec_table
    elif spec.data_type_def is not None:
         ^^^^^^^^^^^^^^^^^^
AttributeError: 'LinkSpec' object has no attribute 'data_type_def'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/rly/mambaforge/envs/test/lib/python3.11/site-packages/sphinx/cmd/build.py", line 293, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rly/mambaforge/envs/test/lib/python3.11/site-packages/sphinx/application.py", line 272, in __init__
    self._init_builder()
  File "/Users/rly/mambaforge/envs/test/lib/python3.11/site-packages/sphinx/application.py", line 343, in _init_builder
    self.events.emit('builder-inited')
  File "/Users/rly/mambaforge/envs/test/lib/python3.11/site-packages/sphinx/events.py", line 108, in emit
    raise ExtensionError(__("Handler %r for event %r threw an exception") %
sphinx.errors.ExtensionError: Handler <function run_doc_autogen at 0x1032058a0> for event 'builder-inited' threw an exception (exception: 'LinkSpec' object has no attribute 'data_type_def')
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 a pull request may close this issue.

1 participant