-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
transforms module api changes in the documentation #11572
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
base: main
Are you sure you want to change the base?
Conversation
1d03a8f
to
095cb54
Compare
This kind of looks like a manual way of doing what the sphinx |
I finally find the problem. Some of the methods docstrings had a first line that ended with Here is the new I am going to edit the method docstrings in a better way later. |
Does this impact other pages? If it does not should we be using this else where? |
No, it doesn't impact any other pages at the moment. I think that it should be used on modules with many classes/functions or when the classes has many methods, like for example the figure module. |
lib/matplotlib/transforms.py
Outdated
a c e | ||
b d f | ||
0 0 1 | ||
2D affine transformations are performed using a 3x3 numpy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The info that the last line is 0, 0, 1 seems worth leaving in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to look through those changes later. I just wanted a working example when I found out what cases the warnings.
Looks good and I guess may be worth making this template the default and opt-out on a case by case basis if needed. |
Let me first say that I would really support making use of the The problem of
is not possible, I would prefer to use the Expanded form:
and not artificially introduce new paragraphs like
But maybe I'm missing something here?
If this is really a problem, it does at least not accur in any of the cases where an autoclass-type template is in use, simply because otherwise we would see such errors popping up. But I can imagine that such cases are present in docstrings that are currently produced via |
I don't know the details about |
The problem with
|
I have been thinking about starting a discussion about how to render the API but I wanted this to work before I did that. I believe that completely auto generated module pages are sometimes good and sometimes not. I think that modules with many classes and/or functions need some manual editing (or special flags in the module files) to order the classes and functions in some way.
|
The questions are something like:
|
So does the Expanded form work? It should, as far as I can see. If we stick to this specific case of the transforms docs, you would not want to actually hardcode all classes and methods, but rather have that list autogenerated. Once you found out how to do that, the same method can be applied to many other pages (not all, for sure, e.g. |
What do you mean with the expanded form? The solution in this PR hardcode the classes and nothing more. The advantage of this is that you can change the order of the classes or put them in sections. The order here is actually the one in |
See my previous post.
Exactly. I'm questioning that hardcoding is the best solution here and would prefer an automated solution, as would e.g. be possible with |
The template automodule.rst, autofunctions.rst and autoclass.rst more or less does the same things on different objects. One drawback with them are that they work with the autosummary directive so that something needs to be hard coded to actually let the scripts work and the autogenerated stuff get on a new page. This is not really a problem in for example the I don't think that it is possible to use the scripts without using the autosummary directive. I believe that you easily can get a good result with the templates that exist now and it is possibly to make a new template slightly differently to fit a special module better (the automodule is actually written for axes_grid and the autofunction for pyplot). It is easy to do the manual work and the result is often better with some easy to do editing. One method I think should work for a completely automatic rendering is to write a .rst file in the api folder that make an autosummary, with automodule (that use autoclass.rst) of one, or several modules and then link the files from |
Seems like this brings us back to the start: One should try out the |
I have tried automodapi, the result can be seen in #11595, if it can be used on circleci. The result looks good but I am note sure if it is possible to include the links to the examples without same hacking. |
I am going to re-milestone this as 3.1 (in the interest of getting the 'must get done' list down to something reasonable), but it can go in when ever it is ready. |
I just want to say that the work that both @fredrik-1 and @ImportanceOfBeingErnest are doing here is important, hard, and appreciated! |
76c76e6
to
fd8aef9
Compare
I edited the Here is the result. I think this is a good solution for rendering a module. It might be possible to get the same result automatically with |
@timhoffm this could use your attention... |
Since this Pull Request has not been updated in 60 days, it has been marked "inactive." This does not mean that it will be closed, though it may be moved to a "Draft" state. This helps maintainers prioritize their reviewing efforts. You can pick the PR back up anytime - please ping us if you need a review or guidance to move the PR forward! If you do not plan on continuing the work, please let us know so that we can either find someone to take the PR over, or close it. |
I thought that it was very difficult to get an oversight of the
transforms
module in the documentation so I propose a change.I wrote a new
autosummary
templateautoclass.rst
and used it for rendering thetransforms
module.I think that it result in a much easier to read documentation without the need of much manual work.
edit: I don't understand why I get a warning/home/circleci/project/doc/api/_as_gen/matplotlib.transforms.Affine2D.rst:2:Literal block expected; none found.
I have tested many variants of the template. The resulting files look good to me and the html files looks and works as expected when I build them on my computer (with the same warning).