Skip to content

Conversation

takanori-pskq
Copy link

Related to #13114. See #16736 (comment). .. currentmodule didn't work, so I used .. auto*:: numpy::ma.* instead. After this change, methods in numpy(e.g. lexsort) can be found, but methods in numpy.ma(e.g. MaskedArray.*) cannot be found.

@takanori-pskq
Copy link
Author

takanori-pskq commented Oct 9, 2020

Or is it a good idea to apply this kind of change to not only ma but also all docstrings ? It is much simpler (only modifing {{ objname }} to {{ fullname|replace("numpy.", "numpy::") }} in autosummary/*.rst, and no need to add templates ma/*.rst and :template: options)

@mattip
Copy link
Member

mattip commented Oct 29, 2020

Could you link to this in the rendered docs?

@takanori-pskq
Copy link
Author

For example: https://16245-908607-gh.circle-artifacts.com/0/doc/build/html/reference/generated/numpy.ma.MaskedArray.argsort.html
Here now `lexsort` can reference to numpy.lexsort, but `MaskedArray` cannot reference to numpy.ma.MaskedArray. (before: https://numpy.org/devdocs/reference/generated/numpy.ma.MaskedArray.argsort.html)

@mattip
Copy link
Member

mattip commented Oct 29, 2020

Ahh, I see, thanks.

It is much simpler (only modifying...

Worth a try, if it is not too complicated. It would be nice to add a comment near the change to explain what is going on.

@takanori-pskq
Copy link
Author

Another way mentioned above is in the PR #17691 .

@mattip
Copy link
Member

mattip commented Nov 4, 2020

Closing in favor of gh-17691

@mattip mattip closed this Nov 4, 2020
@takanori-pskq takanori-pskq deleted the i13114-ma-docstring branch November 4, 2020 13:35
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