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: Add docstrings for some scalar types #17521

Merged
merged 5 commits into from
Oct 12, 2020

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Oct 9, 2020

r"""
A byte string.

When used in array, this type cannot contain trailing nulls.
Copy link
Member Author

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...

@@ -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_'],
Copy link
Member Author

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')
Copy link
Member

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.

Copy link
Member Author

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

@eric-wieser
Copy link
Member Author

eric-wieser commented Oct 12, 2020

Somehow this caused a segfault... I've restarted the test to see if it was random...

@charris
Copy link
Member

charris commented Oct 12, 2020

Somehow this caused a segfault

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.

@eric-wieser
Copy link
Member Author

Unfortunately the act of restarting the build threw away the build log...

@charris charris merged commit a34cfc9 into numpy:master Oct 12, 2020
@charris
Copy link
Member

charris commented Oct 12, 2020

Thanks Eric. Do you recall which test run segfaulted?

@eric-wieser
Copy link
Member Author

eric-wieser commented Oct 12, 2020

Yes, it was this one before it was restarted: https://travis-ci.org/github/numpy/numpy/jobs/734723008

@charris
Copy link
Member

charris commented Oct 12, 2020

ISTR that the previous segfault was also in the NPY_RELAXED_STRIDES_CHECKING=0 run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants