Repository navigation
docs: add container types documentation (#3349) - #10775
Conversation
|
Update on CI failure: The Sphinx build in CI was failing due to an undefined reference label ( I have updated line 121 in |
|
Hi @swap357, I've resolved all the CI check failures:
All checks are now green. Please review when you get a chance! |
|
Hi @coderay3000, Thank you for PR and making contributions to Numba! Could you please address the errors on the CI jobs ? This can be done by making the Release Note of form: For example: https://github.com/numba/numba/blob/main/docs/upcoming_changes/10528.bug_fix.rst |
|
Hi @kc611, Thank you! I have updated the release note fragment ( |
esc
left a comment
There was a problem hiding this comment.
@coderay3000 thank you for submitting this PR!
I would like to request three changes:
a) The containers are documented already: https://numba.readthedocs.io/en/stable/reference/pysupported.html#typed-list -- so just mention the types here and then create a link to the already exitsting documentation.
b) There is also a typed set, please add that type here too.
c) The towncrier snippet is incorrectly formatted, please take a look and fix this.
Feel free to followup with questions, in case the above is not clear.
swap357
left a comment
There was a problem hiding this comment.
Found a problem with sample on DictType-
|
|
||
| >>> from numba import types, typed | ||
| >>> dict_type = types.DictType(types.unicode_type, types.int64) | ||
| >>> typed.Dict.empty_dict(types.unicode_type, types.int64) |
There was a problem hiding this comment.
the sample here is incorrect. There's no typed.Dict.empty_dict:
>>> from numba import types, typed
>>> dict_type = types.DictType(types.unicode_type, types.int64)
>>> typed.Dict.empty_dict(types.unicode_type, types.int64)
Traceback (most recent call last):
File "<python-input-2>", line 1, in <module>
typed.Dict.empty_dict(types.unicode_type, types.int64)
^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'Dict' has no attribute 'empty_dict'
There was a problem hiding this comment.
as @esc mentioned, the documentation with sample snippets is on - https://numba.readthedocs.io/en/stable/reference/pysupported.html
that can be used as reference.
|
Hi @esc, Thanks for the detailed review! I have updated the PR according to your suggestions:
All changes have been committed and pushed. Please take a look when you get a chance! |
|
Hi @swap357, Thanks for pointing that out! As per the feedback from you and @esc, I have completely removed the sample code snippets from The updated changes are pushed and ready for review! |
esc
left a comment
There was a problem hiding this comment.
Thank you for the updates, one final nitpick to resolve, then OK to merge!
Thank you for the patch ❤️
esc
left a comment
There was a problem hiding this comment.
This underline style is to be preferred.
Co-authored-by: Emergency Self-Construct <esc@users.noreply.github.com>
Co-authored-by: Emergency Self-Construct <esc@users.noreply.github.com>
| @@ -0,0 +1,4 @@ | |||
| Document container types in reference manual | |||
| ----------------------------------------------------------- | |||
There was a problem hiding this comment.
Yeah, so sorry, this needs to be the same length as the text above.
There was a problem hiding this comment.
No problem at all! I've updated the underline length to match the title exactly. Thanks @esc!
There was a problem hiding this comment.
Yes, but you used = instead of -...
There was a problem hiding this comment.
oh, I see, you fixed it later on, thank you.
There was a problem hiding this comment.
You're welcome! Apologies for the initial confusion with the formatting and references. I've updated everything according to the guidelines, and all CI checks are green now.
Thanks a lot for your patience and guidance!
|
Happy to contribute! Thanks for merging. |
Description
This PR adds documentation for Numba's strongly-typed containers (
ListTypeandDictType) under a new Containers section indocs/source/reference/types.rst.Changes Made
Containerssubsection underTypes and signaturesintypes.rst... class::) and usage examples fornumba.types.ListTypeandnumba.types.DictType.Related Issue
Closes #3349
AI / LLM Disclosure
Google Gemini was used as an AI assistant to help format the reStructuredText (
.rst) syntax and verify doc directives. All generated content and formatting were manually reviewed and validated prior to submission.