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

[DOC]: sphinx fails to document a type alias for dict #1956

Open
2 tasks done
dagardner-nv opened this issue Oct 18, 2024 · 1 comment
Open
2 tasks done

[DOC]: sphinx fails to document a type alias for dict #1956

dagardner-nv opened this issue Oct 18, 2024 · 1 comment
Assignees
Labels
doc Improvements or additions to documentation

Comments

@dagardner-nv
Copy link
Contributor

How would you describe the priority of this documentation request

Critical (currently preventing usage)

Please provide a link or source to the relevant docs

https://github.com/nv-morpheus/Morpheus/blob/branch-24.10/python/morpheus/morpheus/utils/type_aliases.py

Describe the problems in the documentation

Attempting to document this alias:

TensorMapType = dict[str, NDArrayType]

Yields this error, which appears to be a variant of sphinx-doc/sphinx#8493

sphinx.errors.SphinxWarning: /home/dagardner/work/morpheus/python/morpheus/morpheus/utils/type_aliases.py:docstring of builtins.dict:20:autosummary: failed to import clear.
Possible hints:
* ValueError: not enough values to unpack (expected 2, got 1)
* ModuleNotFoundError: No module named 'clear'
* KeyError: 'clear'
* AttributeError: module 'morpheus.utils.type_aliases' has no attribute 'clear'
* ModuleNotFoundError: No module named 'morpheus.utils.type_aliases.clear'; 'morpheus.utils.type_aliases' is not a package

Warning, treated as error:
/home/dagardner/work/morpheus/python/morpheus/morpheus/utils/type_aliases.py:docstring of builtins.dict:20:autosummary: failed to import clear.
Possible hints:
* ValueError: not enough values to unpack (expected 2, got 1)
* ModuleNotFoundError: No module named 'clear'
* KeyError: 'clear'
* AttributeError: module 'morpheus.utils.type_aliases' has no attribute 'clear'
* ModuleNotFoundError: No module named 'morpheus.utils.type_aliases.clear'; 'morpheus.utils.type_aliases' is not a package
ninja: build stopped: subcommand failed.

Changing the alias to use typing.Dict avoids the issue:

TensorMapType = typing.Dict[str, NDArrayType]

(Optional) Propose a correction

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I have searched the open documentation issues and have found no duplicates for this bug report
@dagardner-nv dagardner-nv added the doc Improvements or additions to documentation label Oct 18, 2024
@dagardner-nv dagardner-nv self-assigned this Oct 18, 2024
@dagardner-nv
Copy link
Contributor Author

I was able to repro the issue outside of Morpheus without any of our code in as simple of a repro as possible (https://github.com/dagardner-nv/repro_1956).

Through trial/error I was able to isolate the issue to the numpydoc extension, and opened up:
numpy/numpydoc#587

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Improvements or additions to documentation
Projects
Status: Todo
Development

No branches or pull requests

1 participant