Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b918016
DOC starting the migration to sphinx
NelleV Mar 8, 2017
b110b1f
DOC Set up sphinx-gallery in parallel of our own gallery
NelleV Mar 9, 2017
ba6d268
DOC added sphinx-gallery as a requirement
NelleV Mar 11, 2017
c908f98
DOC Added readme files to include examples in SG
NelleV Mar 11, 2017
c61c856
DOC SG doesn't support parallel builds yet
NelleV Mar 11, 2017
eaaf182
DOC lines, bars and markers is now full SG
NelleV Mar 11, 2017
4f92501
DOC examples/statistics is fully SG
NelleV Mar 11, 2017
40eab47
DOC pie and polar charts is now full SG
NelleV Mar 11, 2017
9738124
DOC subplots, axes and figures are now full SG
NelleV Mar 11, 2017
8f8d316
DOC added ticks and spines to sphinx-gallery
NelleV Mar 12, 2017
55a5840
DOC image, contours and fields are fully SG compatible
NelleV Mar 16, 2017
9bf91a8
DOC showcase are fully SG compatible
NelleV Mar 16, 2017
f50ab00
DOC text, labels and annotations are fully SG compatible
NelleV Mar 16, 2017
7c79b12
DOC tick and spines is now full SG compatible
NelleV Mar 16, 2017
1ed25aa
DOC shapes and collections is now fully SG compatible
NelleV Mar 17, 2017
8bc4597
DOC mplot3d is fully SG-compatible
NelleV Mar 19, 2017
d5583f8
DOC The gallery is now built with sphinx-gallery
NelleV Mar 19, 2017
8f5f185
DOC all plots in the gallery now produce images
NelleV Mar 19, 2017
9d805a1
DOC API is now fully SG-compatible
NelleV Mar 19, 2017
4a13444
DOC linking to auto_examples when possible
NelleV Mar 19, 2017
8b764e7
DOC FIX nitpicks in the conf file
NelleV Mar 25, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
DOC FIX nitpicks in the conf file
  • Loading branch information
NelleV committed Apr 6, 2017
commit 8b764e7d6c20e40a7014939003410079c37ab962
5 changes: 3 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
try:
import sphinx_gallery
except ImportError:
raise ImportError("No module named sphinx-gallery - you need to install "
"numpydoc to build the documentation.")
raise ImportError("No module named sphinx_gallery - you need to install "
"sphinx_gallery to build the documentation.")

try:
import colorspacious
Expand Down Expand Up @@ -112,6 +112,7 @@
'gallery_dirs' : 'auto_examples'}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we not put it in gallery instead? Or if it were mpl_examples, then some of the lines that were changed would not have been necessary.

Whatever it becomes, I don't like the auto_ prefix; it's an internal concern and doesn't really make any sense to present that in the URL to a user from a semantic point of view.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's the default and is a convention followed by many (if not all) the projects. I'd rather stick with it for consistency.
We can't rename this to mpl_examples as mpl_examples still exists.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure those are compelling reasons. I went back through the blame 7 years and couldn't find any reasoning behind it (that's not to say that there wasn't one.) My reasoning here is that URLs should be discoverable, simple, and at least try to give some semantic meaning.

A user might go to matplotlib.org/gallery or matplotlib.org/examples directly (yes, there's Google, but let's assume they're not using it for some reason), but there's a 99% chance that no-one will spontaneously go to matplotlib.org/auto_examples.

And what does the "auto_" prefix mean? It means that the rst was automatically generated from the example Python code. This is a meaningless distinction to a user. When they see "auto", they see "automatically generated" aka "not hand-written" aka "not very good". I'm not going to claim that all of our examples are 100% clear, but they've all been hand-written in some fashion, and some of them are even quite amazing.

In fact, for that same reasoning, I've just talked myself into retracting the "mpl_examples" suggestion, since the "mpl_" prefix is redundant and meaningless in this context. Also, our existing site uses matplotlib.org/examples/ and matplotlib.org/gallery.html; I don't think we should break that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For the time being, the folder cannot be neither "examples" nor "mpl_examples", and this will not change in the foreseeable future considering the state of our examples (unless we remove all examples that are not SG compatible).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's not possible to rename the current examples/mpl_examples to make room for the gallery-based examples? I strongly dislike the auto_examples name as well--I've overridden that name for sphinx-gallery in my own projects.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will this end up exposed in the URL?

If so, I think we should pick something either a) shorter (ex sg or ae) or b) something more meaningful.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I does show up in the URL, for example this is our gallery at MNE-python. It does have auto-examples in the page, though that's sorta become the convention with sphinx-gallery (same goes for scikit-learn: http://scikit-learn.org/stable/auto_examples/index.html).

I seem to remember conversations with folks that this was a non-trivial thing to change but I could be wrong...it's been working out well enough for us. If you want you could use an .rst file that contains the gallery itself, then the objects that the gallery links to would be in the auto_examples folder.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nope, it's completely trivial to change: https://unidata.github.io/MetPy/examples/index.html

I'm going to argue one more time NOT to use auto_examples. Whether they're generated automatically or not is immaterial to the user, so we should NOT be bleeding that implementation detail of our documentation build procedure to the outside world.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's not that trivial, because matplotlib somehow does I don't know what in the plot directive that makes this a pain in the butt to change. Which is why I asked for feedback a month ago.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FWIW I'll give this a shot to change the name to examples_gallery. It doesn't look completely trivial in the sense that there are links hard-coded all over the codebase. There are also some weird errors happening inside the plot directive that I can try to debug. I'll open a separate PR then if I can figure it out.


plot_gallery = True
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Blank line after.


# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2567,7 +2567,7 @@ def pie(self, x, explode=None, labels=None, colors=None,

Examples
--------
.. plot:: mpl_examples/pie_and_polar_charts/pie_demo_features.py
.. plot:: mpl_examples/pie_and_polar_charts/plot_pie_features.py


"""
Expand Down