-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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: Add docstrings for some scalar types #17521
Conversation
numpy/core/_add_newdocs_scalars.py
Outdated
r""" | ||
A byte string. | ||
|
||
When used in array, this type cannot contain trailing nulls. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to avoid describing the awkwardness that is #15477 here...
numpy/core/_add_newdocs_scalars.py
Outdated
@@ -176,6 +176,46 @@ def add_newdoc_for_scalar_type(obj, fixed_aliases, doc): | |||
Any Python object. | |||
""") | |||
|
|||
add_newdoc_for_scalar_type('str_', ['str0', 'unicode_'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's tempting to just not mention these str0
etc types. No one should be using them, and documenting them might just encourage people.
Either an opaque sequence of bytes, or a structure. | ||
|
||
>>> np.void(b'abcd') | ||
void(b'\x61\x62\x63\x64') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is failing the doctests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - fixed with a raw-string, I think
Somehow this caused a segfault... I've restarted the test to see if it was random... |
Hmm, there was another segfault not too long ago, I don't recall the details, but it also went away on second try. Worth noting. |
Unfortunately the act of restarting the build threw away the build log... |
Thanks Eric. Do you recall which test run segfaulted? |
Yes, it was this one before it was restarted: https://travis-ci.org/github/numpy/numpy/jobs/734723008 |
ISTR that the previous segfault was also in the |
Partially addresses #10106. Feel free to suggest and/or commit improvements.
https://16285-908607-gh.circle-artifacts.com/0/doc/build/html/reference/arrays.scalars.html?highlight=scalars#other-types