Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Issues with new sphinx-gallery examples #199

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
mwaskom opened this issue Jul 10, 2017 · 7 comments · Fixed by #205
Closed

Issues with new sphinx-gallery examples #199

mwaskom opened this issue Jul 10, 2017 · 7 comments · Fixed by #205

Comments

@mwaskom
Copy link
Member

mwaskom commented Jul 10, 2017

I just noticed to issues with the new example gallery:

  • We have a few examples that don't produce an image (the ones where the script name does not start with plot_*, which was originally how we identified which scripts should populate the gallery)
  • Examples that produce a multi-panel figure no longer show the multi-panel image that gets saved; now they show four separate images and only one becomes the thumbnail.
@mwaskom
Copy link
Member Author

mwaskom commented Jul 10, 2017

Also previously the examples were loosely ordered alphabetically to go in a loosely ascending order of complexity/how common the task is, which is no longer the case.

@larsoner
Copy link
Contributor

I won't have time to look at this anytime soon. Feel free to roll back to the old version if need be

@larsoner
Copy link
Contributor

Actually I have a bit of time now...

Also previously the examples were loosely ordered alphabetically to go in a loosely ascending order of complexity/how common the task is, which is no longer the case.

Two options for this one:

  1. Change titles instead of filenames to go roughly in order
  2. Create subdirectories with themes ("basic", "meg", etc.), each with a README.rst like here

Examples that produce a multi-panel figure no longer show the multi-panel image that gets saved; now they show four separate images and only one becomes the thumbnail.

This one can't be easily fixed unfortunately. :( One way to fix it would be to 1) take a screenshot of the PySurfer window, 2) plot it using matplotlib, and 3) tell SG to use this instead of the first image, but it's a bit of a hack.

We have a few examples that don't produce an image

I actually don't mind this too much. It's nice to have them listed on the page, even if it's with a default thumbnail. Alternatively, we can make them produce some image.

@larsoner
Copy link
Contributor

Also previously the examples were loosely ordered alphabetically to go in a loosely ascending order of complexity/how common the task is, which is no longer the case.

So it turns out SG by default orders examples by the number of code lines, so it should still in some sense be ordered by complexity. But there is a PR in the works to allow explicit ordering.

@mwaskom how was the ordering actually defined before? I think it might have been filename-alphabetical, in which case the SG PR mentioned above also adds this option, and we can use it until someone wants to explicitly reorder.

Can we live with the single-image problem, and the no-image-produced problem (I don't actually think it's a problem...?) and close this once the ordering problem is solved?

@mwaskom
Copy link
Member Author

mwaskom commented Jul 31, 2017

@mwaskom how was the ordering actually defined before? I think it might have been filename-alphabetical, in which case the SG PR mentioned above also adds this option, and we can use it until someone wants to explicitly reorder.

It was alphabetical by filename. But the SG default seems reasonable.

Can we live with the single-image problem, and the no-image-produced problem (I don't actually think it's a problem...?) and close this once the ordering problem is solved?

The single-image problem strikes me as a little weird in that what the example shows isn't actually what the user will see (i.e. it doesn't show of your nice work putting the split brains together). But if it's simply undoable, oh well. I think the small number of examples with no image generated make the gallery look a little blighted, but it should be easy to make those scripts generate an image (I'm actually not sure why they don't?)

@larsoner
Copy link
Contributor

Alphabetical by filename is also doable, let me know if you'd prefer that (old way) to the SG default (number of lines).

I also noticed that the size of thumbnails decreased from ~250x250 to ~112x112, do you want me to bump that back up while I'm in there? I plan to figure out how to set it in SG using CSS.

@larsoner larsoner mentioned this issue Jul 31, 2017
2 tasks
@mwaskom
Copy link
Member Author

mwaskom commented Aug 1, 2017

I also noticed that the size of thumbnails decreased from ~250x250 to ~112x112, do you want me to bump that back up while I'm in there? I plan to figure out how to set it in SG using CSS.

Yeah, looking at the doc build from the last PR, the thumbnails are pretty small. I think 250 is a good size.

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 a pull request may close this issue.

2 participants