Skip to content

DOC: move arranging axes tutorial to users #24979

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
wants to merge 1 commit into from

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Jan 14, 2023

PR Summary

This is a test to see how easy it is to move a tutorial into the users docs, making it a native rst file instead of using sphinx-gallery. Turns out its pretty easy, with a couple of important caveats...

  1. a method defined in one plot directive is not remembered in the next plot directive, so far as I can tell, causing that plot to fail.
  2. plot directives do not have hi-res/low-res versions of themselves made, which is probably a trivial fix to the plot directive.

All that was done here was to run sphinx gallery on /tutorials/intermediate/arranging_axes.py and then hand-edited the arranging_axes.rst to replace .. code-block:: default with

.. plot::
    :include-source:
    :align: center

and then remove the .. image-sg :: directives.

Note, that I'm not arguing we should get rid of sphinx gallery. However, many of the explanatory tutorials should probably be logically be under /users. This is just a proof of concept to see what such a migration would look like

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

@jklymak jklymak marked this pull request as draft January 14, 2023 05:05
@jklymak jklymak changed the title DOC: move arrangibg axes tutorial to users DOC: move arranging axes tutorial to users Jan 14, 2023
@timhoffm
Copy link
Member

Note, that I'm not arguing we should get rid of sphinx gallery. However, many of the explanatory tutorials should probably be logically be under /users. This is just a proof of concept to see what such a migration would look like

Just as a remark: If we want to keep Sphinx-gallery for some reason, we could also place a gallery under users. We also don't have to use the tiled gallery entry page if we prefer a something else. One can ar least hide it and instead link from a custom overview page.

@jklymak
Copy link
Member Author

jklymak commented Jan 14, 2023

@timhoffm yes that makes sense. I also wonder if it is possible to mix rst and py files in a "gallery" - perhaps that's a better way to do all this. On the other hand, I think it's still worth looking into how to add the hi res plots to our plot directive like we did for sphinx gallery.

@jklymak
Copy link
Member Author

jklymak commented Jan 14, 2023

Just to follow up on this - it may indeed be possible to put a gallery under /users/, but it is not possible, so far as I can tell, to add bare *.rst files to a gallery directory with and *.py files and have them copied over into the gallery's rst subdirectory.

To be more explicit: adding /tutorials/intermediate/boo.rst doesn't copy the new boo.rst into /doc/tutorial/intermediate with the rest of the sphinx-gallery files.

So, we have the conundrum that if we keep the tutorials as tutorials they would have to be in a different directory, and if we move them to be rst, then there two disadvantages above would be present. I think making the plot_directive output hires is easy-ish. I am not sure that making plot directive objects global to the rest of the file is going to be easy though.

I think perhaps the best solution for now is to add individual tutorials to the table of contents under users. Sure, a tutorial will show up in two places, but it will make the users guide more of a users guide.

@story645
Copy link
Member

We also don't have to use the tiled gallery entry

I think that's one of the most useful features of sphinx gallery and one of my concerns about moving things out of gallery is losing the thumbnails. A major advantage of viz stuff is you don't need to know what it's called, just need to find the picture that looks like what you're trying to do.

@jklymak
Copy link
Member Author

jklymak commented Jan 15, 2023

I don't personally think we should get rid of the Gallery or the tutorials. Just curate them a bit, and some of the tutorials could optionally move over into users.

However, I think that is less urgent given how #24987 looks in the docs, where the tutorials don't look like tutorials in the sidebar navigation when referenced from users/.

@jklymak jklymak closed this Mar 17, 2023
@jklymak jklymak deleted the doc-move-arranging-axes branch March 17, 2023 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants