Skip to content

DOC: user/explain reorg (and moving a lot of tutorials). #25395

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 23 commits into from
Mar 17, 2023

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Mar 5, 2023

PR Summary

This is a big documentation re-organization. It addresses the problem that the tutorials have much of what should really be part of a Users Guide, but are not organized as a Guide, and are lacking some narrative glue to bring them together. The over-all idea here is to basically make /users/explain a sphinx-gallery based Using Matplotlib Guide.

Overview

Most of what is in galleries/tutorials has been moved to galleries/users_explain, which gets served at /users/explain in the docs, replacing the material that was formerly there. /users/explain now has the following sections:

  • Quick start guide
  • Figures
  • Axes (or Subplots)
  • Using Artists
  • Customizing Matplotlib with style sheets and rcParams
  • Controlling and labelling Axis objects
  • Colors
  • Text
  • Animations using Matplotlib
  • Toolkits

Some of these were directly copied over from tutorials, others we re-organized some. For instance there is a new axes/index.rst that tries to explain Axes.

Much of the "Advanced" and some of the "Intermediate" material was put in a table of contents. eg. /galleries/users_explain/artists/index.rst has a general introduction to Artists, followed by:

.. toctree::
    :maxdepth: 1

    Concept: Automated color cycle <color_cycle>
    Concept: optimizing Artists for performance <performance>
    Concept: Paths <paths>
    Concept: Path effects guide <patheffects_guide>
    In Depth: understanding the extent keyword argument of imshow <imshow_extent>
    transforms_tutorial

I did almost no editing of any of the material. Some probably needs it after being moved, but getting it to the "right" spot is a start.

Redirects and refs:

  • Everything I moved, I used a redirect-from directive to keep book marks correct.
  • For anything I moved I changed :doc: references to :ref: references. That will make any further re-organization easier.

Plan forward

This is too big to review in whole. I think it would be most productive if folks would comment on the

a) the general structure
b) any suggestions for top-level sections and structure of users/explain
c) comment on any sub-pages that they feel are mis-placed

My hope would be to get the structure merged soonish so that we have the rest of the 3.8 cycle to continue to fix it. The little bit of new material should be reviewed/rewritten at that point, probably someone other than me, but I'll argue that it should be merged before it's perfect. The old material we should go through to improve and better integrate. We should also take PRs to fill in any gaps.

Where did things go?

Easiest to see where all the tutorials went at the new index page.

Actual new files:

  • galleries/tutorials/index.rst (instead of the old README.rst, so the TOC could be added).
  • galleries/users_explain/artists/index.rst
  • galleries/users_explain/axes/index.rst

Obvious Todos

  • Axis is not done
  • Make users_explain/index.rst look better
  • Much of the new prose needs to be followed up and cleaned.

@jklymak jklymak force-pushed the doc-user-reorg branch 11 times, most recently from 7b1bc33 to d5db532 Compare March 8, 2023 01:57
@jklymak jklymak marked this pull request as ready for review March 8, 2023 02:42
@jklymak jklymak force-pushed the doc-user-reorg branch 2 times, most recently from 4373b69 to 5f69e98 Compare March 8, 2023 20:27
@jklymak jklymak mentioned this pull request Mar 8, 2023
6 tasks
@melissawm
Copy link
Member

One comment is that it's not clear to me the difference between the tutorials under the user guide and the tutorials that live on the "Tutorials" top navbar. Could we just have all tutorials under the user guide, even if we have to keep two links to it if we don't want to remove the tutorials link from the navbar?

@jklymak
Copy link
Member Author

jklymak commented Mar 9, 2023

One comment is that it's not clear to me the difference between the tutorials under the user guide and the tutorials that live on the "Tutorials" top navbar. Could we just have all tutorials under the user guide, even if we have to keep two links to it if we don't want to remove the tutorials link from the navbar?

Thats up for discussion. My idea was that Tutorials should be walk-throughs, which a couple of the current tutorials are. It may be possible to add more. Conversely most of the things I moved to User Guide were in-depth explanations of particular features. Some of the titles or text didn't change, but I think folks were bending the meaning of "tutorial" and then using that language (including a couple I wrote).

However, I'm open to removing Tutorials altogether, and/or moving some of the material I moved back to Tutorials. Depends on how robust we want that section to be.

@melissawm
Copy link
Member

I see - in that case it sounds good, we should probably have a tracking issue or project listing all documents that should be reviewed for content once this is merged.

As far as making the ToC for users/explain look better - we could experiment with the https://sphinx-design.readthedocs.io/en/latest/index.html elements but I'm not sure we need this, maybe there are better/simpler ways. I tried something but not sure I like it tbh 😄

Screenshot_20230309_174440

@story645
Copy link
Member

story645 commented Mar 9, 2023

Even if we're leaving the gallery, can we still have little thumbnails next to each entry? I really don't want to lose the visual navigation, especially in tutorials where folks may not know what things are called.

Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

I am delegating final authority on this PR to @jklymak to self-merge when he thinks it is ready.

I am pre-approving as well so GH will let him push the green button.

@jklymak
Copy link
Member Author

jklymak commented Mar 9, 2023

Even if we're leaving the gallery, can we still have little thumbnails next to each entry? I really don't want to lose the visual navigation, especially in tutorials where folks may not know what things are called.

Just to be clear, the Examples/Gallery isn't going away, or at least I wouldn't be in favour of that.

I'm not sure most of the thumbnails for the Tutorial section are that useful? I'm totally in favour of adding visual elements to the index.rst files, but I don't think the sphinx-gallery README.txt->index.rst is flexible enough for what we need. OTOH, grabbing the thumbnails, which we know the location of, is a great strategy.

@jklymak
Copy link
Member Author

jklymak commented Mar 9, 2023

As far as making the ToC for users/explain look better - we could experiment with the https://sphinx-design.readthedocs.io/en/latest/index.html

yes, I'm very much in favour of using sphinx-design; I just have made the most basic-looking TOC for now. I actually think making them look better is better dealt with in individual PRs (some of which I may submit) but they should get a full critique.

@jklymak
Copy link
Member Author

jklymak commented Mar 11, 2023

Ping @timhoffm - I pinged you on gitter, but you may not be checking. Is the general idea of this re-org OK with you, with the understanding that details, improved aesthetics, and re-organizations can be done after it is submitted?

@jklymak
Copy link
Member Author

jklymak commented Mar 17, 2023

If there are no general objections I'll merge this tomorrow. I'll also open some issues for individual pages I think need work or a second set of eyes, and folks should feel free to open issues as well.

@jklymak
Copy link
Member Author

jklymak commented Mar 17, 2023

OK this was squash merged. Devs, please note that you need the main branch of sphinx-gallery to build the docs locally for a while.

@jklymak jklymak deleted the doc-user-reorg branch March 17, 2023 16:13

Many of our tutorials were moved from this section to :ref:`users-guide-explain`:

Introductory
Copy link
Member

Choose a reason for hiding this comment

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

IMHO, we do not need to list the moved ones individually. There's a reason they are not in the tutorial section, anymore, so the top-level link given above should be enough. - May be ok to keep for a short transition period.


.. redirect-from:: /users/explain

Using Matplotlib
Copy link
Member

@timhoffm timhoffm Mar 17, 2023

Choose a reason for hiding this comment

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

Before https://matplotlib.org/stable/users/explain/index.html titled "Explanations". Now this URL titles "Using Matplotlib", which is both confusing and changing the semantics.

Coming from
image

I categorize "Using matplotlib" in the top half "partical steps" (not very sure whether it's Tutorials or How-tos), whereas "Explanations" is in the lower part. While we can still move content around, we should get the organizational structure clear in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that graphic is a useful guide. OTOH I don't agree that any given document should be clearly in one section or another or that the top-level doc organization should strictly follow this. Imagine a textbook that only had theory in half the chapters, and worked examples in the other half. A tutorial with no basic "theory" isn't much use, similarly just discussing things in abstract is rarely a good way to learn.

What I have tried to do here is high-level Explanation of what an important part of the library is (say Axes), mixed with simple examples (mini Tutorials). Further Explanations (what we had in "Intermediate" and "Advanced") are then in the table of contents of that Section, and we should add more links to the examples (eg, Tutorials/How-to guides).

My argument would be that we never had the high-level explanations. Sometimes the API Reference had some explanation, and we had some getting-started tutorials, but we never explained what a Figure was or what an Axes was. Most of the so-called tutorials were really long Explanations that were easier to write in sphinx-gallery than rst. Some of the material in users/explain was pretty esoteric, other things were really fundamental.

So, I'm open to changing this organization, or changing the name "Using Matplotlib", but I think this is already substantially better than before, and can be filled out over the next few months to be really good.

@timhoffm
Copy link
Member

Aaah, merged while commenting. 🐌 Ping @jklymak, please still have a look at my remarks.

@jklymak
Copy link
Member Author

jklymak commented Mar 17, 2023

@timhoffm we can definitely change all of this based on comments or new issues. Note its not being back ported to 3.7.x so we have a few months to get it right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs comment/discussion needs consensus on next step
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants