Skip to content

DOC: Add docstrings for some scalar types#17521

Merged
charris merged 5 commits intonumpy:masterfrom
eric-wieser:remove-scalar-tables
Oct 12, 2020
Merged

DOC: Add docstrings for some scalar types#17521
charris merged 5 commits intonumpy:masterfrom
eric-wieser:remove-scalar-tables

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

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.

3 participants