Skip to content

BUG: turn member descriptor attributes into links #201

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

Merged
merged 1 commit into from
Mar 20, 2019
Merged

BUG: turn member descriptor attributes into links #201

merged 1 commit into from
Mar 20, 2019

Conversation

mattip
Copy link
Member

@mattip mattip commented Mar 17, 2019

This turns the member descriptors attributes into links, see for instance the member descriptors of numpy.broadcast nd, ndim, and numiter which were inlined, not linked.

I originally got to this since the documentation of those descriptors has an Example section. Inlining it rather than linking causes sphinx to complain that there is more than one Example section.

I am not sure how to write a test for this, as it requires a c-extension to define the member descriptors.

Perhaps this code could be refactored to check for a positive result, not a negative one

Copy link
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could test non-regression on numpy itself, if available. Or is there a memberdescriptor in the standard library? Does namedtuple produce these? (Shooting in the dark)

@mattip
Copy link
Member Author

mattip commented Mar 18, 2019

I tested this on NumPy, it rendered the autosummary methods of numpy.broadcast.{nd, ndim, numiters} as links. namedtuple is pure python but there are memberdescriptors in _codecs. What would a test that uses a .. autosummary:: \n :toctree: look like?

@jnothman
Copy link
Member

jnothman commented Mar 18, 2019 via email

@mattip
Copy link
Member Author

mattip commented Mar 20, 2019

is there something more I should do to get this merged?

@jnothman
Copy link
Member

I forget we don't demand two approvals here

@jnothman jnothman merged commit e47b940 into numpy:master Mar 20, 2019
@jnothman
Copy link
Member

Thanks

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

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.

4 participants