Skip to content

adding gallery sorting #8975

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 3 commits into from
Aug 4, 2017
Merged

adding gallery sorting #8975

merged 3 commits into from
Aug 4, 2017

Conversation

choldgraf
Copy link
Contributor

Now that sphinx-gallery allows you to choose folder ordering within galleries, this is a PR that attempts to give this a shot. I figured it'd be cumbersome to choose a custom ordering for all of our folders, since really we just wanna make sure that a subset are at the top. So, this PR defines that subset, and then lists all the subsequent folders alphabetically.

This PR does:

  1. Add gallery ordering (with a semi-arbitrary ordering chosen by me...lmk if you think it should be different)
  2. Rename the tutorials folders from e.g., 01_introductory -> introductory since we don't need alphanumeric ordering anymore

Let's see how it looks in circle!

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Aug 1, 2017
Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

Looks like you might have missed renaming a few cross-references.

Can you also update the dependencies to require sphinx-gallery>=0.1.12, because otherwise the backreferences fail?

doc/conf.py Outdated
'../tutorials/introductory',
'../tutorials/intermediate',
'../tutorials/advanced']
for folder in glob('../examples/*') + glob('../tutorials/*'):
Copy link
Member

Choose a reason for hiding this comment

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

glob is not sorted.

@QuLogic QuLogic mentioned this pull request Aug 3, 2017
6 tasks
@choldgraf
Copy link
Contributor Author

ok I think I got all the cross references this time :-)

doc/conf.py Outdated
explicit_order_folders = ['../examples/pyplots',
'../examples/statistics',
'../examples/color',
'../examples/pylab_examples',
Copy link
Member

@QuLogic QuLogic Aug 3, 2017

Choose a reason for hiding this comment

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

I think this just got removed with #8983 (might have to rebase to see it, though.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoah way to go @NelleV ! I didn't know we were so close to moving everything outta that folder. I'll rebase and see if it's gone now.

doc/conf.py Outdated
'../examples/statistics',
'../examples/color',
'../examples/pylab_examples',
'../examples/showcase',
Copy link
Member

Choose a reason for hiding this comment

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

Showcase should maybe be higher?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1 for that...any others you'd like to see reordered?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually - I just realized that a better solution here might be to use the viewing data from google analytics to choose the ordering. That might be a kind of self-reinforcing kind of thing, but it's a good first start

doc/conf.py Outdated
'../examples/color',
'../examples/pylab_examples',
'../examples/showcase',
'../tutorials/introductory',
Copy link
Member

@QuLogic QuLogic Aug 3, 2017

Choose a reason for hiding this comment

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

Where should I be looking to find this? In the gallery page, I don't think I see any tutorials after showcase?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The way SG handles this is there's just one list that defines the order priority. So folders inside of tutorials and examples won't be shown together or anything, this just defines the ordering. You can think of this as two separate lists, one for examples and one for tutorials.

@story645
Copy link
Member

story645 commented Aug 3, 2017

Happy dance that there's now ordering, but I do wonder if there's some natural clustering of the categories aside from metrics. The list is:

Pyplot Examples
Statistics
Color
Pylab Examples
Showcase
Animation Examples
Matplotlib API
Axes Grid
Axis Artist
Event Handling
Front Page
Images, contours and fields
Lines, bars and markers
Miscellaneous Examples
mplot3d toolkit
Pie and polar charts
Our Favorite Recipes
Scales in Matplotlib
Shapes and collections
Specialty Plots
Style sheets
Subplots, axes and figures
Text, labels and annotations
Ticks and spines
Units in Matplotlib
Embedding matplotlib in graphical user interfaces
Userdemo
Widgets

I expect that some of these are probably are already being collapsed into each other, but I think some limit like n=10 or whatever a usability expert would suggest on categories (there are almost 30 in the list) could help make it all seem less overwhelming?

@choldgraf
Copy link
Contributor Author

So I am definitely +1 on refactoring the examples (I actually think they should fall into a few sub-categories, since many of those examples aren't going to be of interest to non-dev users). But - that'll be complicated and will do things like breaking hard-links, so I'd prefer if we kept this PR focused on picking and implementing an order. WDYT?

@story645
Copy link
Member

story645 commented Aug 3, 2017

I totally agree it's out scope for this PR, it just seems like the sort of thing someone is already working on concurrently and so figured I'd throw it out there.

As a first pass on ordering, I'm thinking roughly the following clusters:

Pyplot Examples (while this is most searched for, I debate promoting it to top since this isn't the recommended style)

Pylab Examples (though this is gone now?)
Statistics
Specialty Plots

Front Page
Showcase
Our Favorite Recipes
Miscellaneous Examples

Matplotlib API (though should maybe be moved right under/above pyplot examples)
Axes Grid
Axis Artist
Color
Images, contours and fields
Lines, bars and markers
Pie and polar charts
Shapes and collections
Scales in Matplotlib
Subplots, axes and figures
Style sheets
Text, labels and annotations
Ticks and spines
Units in Matplotlib
mplot3d toolkit

Animation Examples
Event Handling
Embedding matplotlib in graphical user interfaces
Widgets
Userdemo

@WeatherGod
Copy link
Member

WeatherGod commented Aug 3, 2017 via email

@story645
Copy link
Member

story645 commented Aug 3, 2017

Totally a mishmash. I just grabbed all the categories that just seem to be about displaying cool plots rather than showing off specific parts of the API 'cause they didn't seem to fit in anywhere else. I totally think they should be renamed and consolidated further.

@choldgraf
Copy link
Contributor Author

Just to re-iterate, this PR isn't about renaming or combining example folders...just agreeing on an initial ordering, though I think it's a good idea to open a subsequent PR about combining etc. I think if that's a direction people are friendly to, it should happen before 2.1 is released, because this will break a lot of links.

to @story645's ordering, I think this is a good start! Agree we should shuffle things around a little bit. @WeatherGod do you have specific changes to the order that make more sense to you?

@choldgraf
Copy link
Contributor Author

choldgraf commented Aug 3, 2017

Here's a quick plot of the top ~20 folders inside of examples. I think we should assume pylab will be split up (which is a great idea IMO).

image

@dstansby
Copy link
Member

dstansby commented Aug 3, 2017

@choldgraf pylab_examples is no more in the master branch

@choldgraf
Copy link
Contributor Author

ok latest push no longer has pylab examples!

@WeatherGod
Copy link
Member

WeatherGod commented Aug 4, 2017 via email

@tacaswell
Copy link
Member

👍 to getting the sorting in at all and defer bikeshedding of names, organization, etc to later work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants