Skip to content

DOC: Add docstrings for some scalar types - #17521

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

charris merged 5 commits into
numpy:masterfrom
eric-wieser:remove-scalar-tables

Conversation

@eric-wieser

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

Copy link
Copy Markdown
Member

Comment thread numpy/core/_add_newdocs_scalars.py Outdated
r"""
A byte string.

When used in array, this type cannot contain trailing nulls.

Copy link
Copy Markdown
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...

Comment thread numpy/core/_add_newdocs_scalars.py
Comment thread numpy/core/_add_newdocs_scalars.py
Comment thread numpy/core/_add_newdocs_scalars.py Outdated
Any Python object.
""")

add_newdoc_for_scalar_type('str_', ['str0', 'unicode_'],

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

eric-wieser commented Oct 12, 2020 •

Copy link
Copy Markdown
Member Author

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

@charris

charris commented Oct 12, 2020

Copy link
Copy Markdown
Member

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
Copy Markdown
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

charris commented Oct 12, 2020

Copy link
Copy Markdown
Member

Thanks Eric. Do you recall which test run segfaulted?

@eric-wieser

eric-wieser commented Oct 12, 2020 •

Copy link
Copy Markdown
Member Author

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

@charris

charris commented Oct 12, 2020

Copy link
Copy Markdown
Member

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