Thanks to visit codestin.com
Credit goes to github.com

Skip to content

The axes module structure #11445

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

Closed
fredrik-1 opened this issue Jun 16, 2018 · 2 comments · Fixed by #23573
Closed

The axes module structure #11445

fredrik-1 opened this issue Jun 16, 2018 · 2 comments · Fixed by #23573

Comments

@fredrik-1
Copy link
Contributor

This is a question or feature request.

I have looked into the documentation and believe that some problems is the result of the axes folder and its structure. I am not sure what is supposed to be automatic and what is not in sphinx but axes.SubplotBase is for example not included in the documentation even though most axes used in matplotlib are probably of that class.

.. automodule:: matplotlib.axes does not work even though Axes and SubplotBase exist in that module.
.. automodule:: matplotlib.axes._subplots works as I would expect but the paths are wrong.

from matplotlib.axes import SubplotBase, Axes works but the class of actual objects are using the full path, for example matplotlib.axes._subplots.AxesSubplot

I don't know much of module structures or module aliases but I think it is kind of inconvenient when different paths are used in different places and I believe that more work than needed is necessary to write the documentation correctly. See for example #11443.

Is it possibly to get a module structure such that the obj.__class__ path is the same as the alias path, i.e. axes.Axes is always used instead of axes._axes.Axes?

@fredrik-1 fredrik-1 changed the title The axes modul structure The axes module structure Jun 16, 2018
@anntzer
Copy link
Contributor

anntzer commented Jun 17, 2018

One can always readjust cls.__module__ post-hoc; setting __all__ appropriately may also help with sphinx.
(A single axes.py would be sufficiently enormous that I think keeping a split implementation is more manageable.)

@dstansby
Copy link
Member

Might be worth checking out http://sphinx-automodapi.readthedocs.io/en/latest/ in the long run, which automatically does module documentation and includes everything.

@QuLogic QuLogic added this to the v3.7.0 milestone Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants