Skip to content

[MRG] Fix for sphinx-gallery 0.3.1 + 404 errors on Debian Jessie packages #13527

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 4 commits into from
Mar 27, 2019

Conversation

lesteve
Copy link
Member

@lesteve lesteve commented Mar 27, 2019

sphinx-gallery 0.3 has changed the output figure numbering in some edge cases (mostly 0.3.1 ignores matplotlib figure numbers see sphinx-gallery/sphinx-gallery#464 for more details). This PR replaces #13513 and should fix the CircleCI build failures in master, e.g. circleci.com/gh/scikit-learn/scikit-learn/52538.

Figure numbering have been changed to ignore matplotlib figure number.
Copy link
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

Hair to give it a try if it passes locally

This docker image uses Debian stretch and fixes the problems seen with apt-get update with Debian jessie.
@lesteve
Copy link
Member Author

lesteve commented Mar 27, 2019

I pushed a simple fix for the CircleCI problem with jessie (circleci/python3.6 uses Debian stretch rather than Debian jessie and should get rid of the problem):

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages  404  Not Found

@lesteve lesteve changed the title [MRG] Fix for sphinx-gallery 0.3.1 [MRG] Fix for sphinx-gallery 0.3.1 + 404 errors on Debian Jessie packages Mar 27, 2019
@thomasjpfan
Copy link
Member

Running ag -i "plt.figure\(\w+\)" examples on ad6a28b returns:

examples/ensemble/plot_feature_transformation.py
94:plt.figure(1)
107:plt.figure(2)

examples/cluster/plot_affinity_propagation.py
49:plt.figure(1)

examples/cluster/plot_color_quantization.py
85:plt.figure(1)
91:plt.figure(2)
97:plt.figure(3)

examples/cluster/plot_adjusted_for_chance_measures.py
74:plt.figure(1)
104:plt.figure(2)

examples/cluster/plot_kmeans_digits.py
108:plt.figure(1)

examples/cluster/plot_mean_shift.py
45:plt.figure(1)

examples/gaussian_process/plot_gpc_isoprobability.py
67:fig = plt.figure(1)

examples/linear_model/plot_lasso_coordinate_descent_path.py
49:plt.figure(1)
64:plt.figure(2)
77:plt.figure(3)

examples/feature_selection/plot_feature_selection.py
43:plt.figure(1)

examples/manifold/plot_mds.py
61:fig = plt.figure(1)

examples/exercises/plot_iris_exercise.py
42:    plt.figure(fig_num)

examples/applications/plot_outlier_detection_housing.py
80:    plt.figure(1)
86:    plt.figure(2)
97:plt.figure(1)  # two clusters
119:plt.figure(2)  # "banana" shape

Seems to be needed to convert doc/images/iris.svg.
@adrinjalali
Copy link
Member

curious, how did you find which fonts it needs?

@adrinjalali
Copy link
Member

Could you please also do a [doc build] commit to check the complete build?

@lesteve lesteve force-pushed the fix-sphinx-gallery-0.3.1 branch from a0388c2 to 602de82 Compare March 27, 2019 14:12
@lesteve
Copy link
Member Author

lesteve commented Mar 27, 2019

@thomasjpfan basically the problem with sphinx-gallery 0.3.1 only appears when your use figure numbers that don't match the default matplotlib figure numbering (i.e. 1, 2, 3, ..., n_figures). So I only fixed the examples with non-default matplotlib numbering (I even cheated intially and did git grep 000.png to find the included images that were starting at 000.png rather than 001.png). After that I did look at git grep -P 'plt.figure\(.+\)' to figure out which additional examples were problematic.

@adrinjalali I used docker with the circleci/python3.6 image locally to quickly debug. I then guessed by trial and error + googling. Luckily (or unluckily it depends) I had a similar convert error recently on my computer (for some reasons /etc/ImageMagick-6/policy.xml was disabling PS conversions ...). FYI in both cases the problematic image was doc/images/iris.svg (my understanding is that sphinx converts it to a png during the build).

I pushed a commit fixing an example I missed before and [doc build].

@lesteve
Copy link
Member Author

lesteve commented Mar 27, 2019

The CircleCI build is green and the build doc looks fine AFAICT (I compared the generated doc in this PR vs the dev doc visually, using https://53032-843222-gh.circle-artifacts.com/0/doc/_changed.html).

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

Awesome!

@adrinjalali adrinjalali merged commit 3aefc83 into scikit-learn:master Mar 27, 2019
@lesteve lesteve deleted the fix-sphinx-gallery-0.3.1 branch March 27, 2019 15:01
@lesteve
Copy link
Member Author

lesteve commented Mar 27, 2019

FYI the CircleCI is green on master too: https://circleci.com/gh/scikit-learn/scikit-learn/53038 (you never know the pdf build is more finicky sometimes ...).

@adrinjalali adrinjalali mentioned this pull request Mar 27, 2019
2 tasks
@jnothman
Copy link
Member

Thanks for fixing this everyone

xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
…kages (scikit-learn#13527)

* Fix for sphinx-gallery 0.3.1.

Figure numbering have been changed to ignore matplotlib figure number.

* Use circleci/3.6 image.

This docker image uses Debian stretch and fixes the problems seen with apt-get update with Debian jessie.

* Install additional fonts.

Seems to be needed to convert doc/images/iris.svg.

* Another missed example using figure number 0.

[doc build]
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 2019
…kages (scikit-learn#13527)

* Fix for sphinx-gallery 0.3.1.

Figure numbering have been changed to ignore matplotlib figure number.

* Use circleci/3.6 image.

This docker image uses Debian stretch and fixes the problems seen with apt-get update with Debian jessie.

* Install additional fonts.

Seems to be needed to convert doc/images/iris.svg.

* Another missed example using figure number 0.

[doc build]
jnothman pushed a commit that referenced this pull request Jul 29, 2019
…kages (#13527)

* Fix for sphinx-gallery 0.3.1.

Figure numbering have been changed to ignore matplotlib figure number.

* Use circleci/3.6 image.

This docker image uses Debian stretch and fixes the problems seen with apt-get update with Debian jessie.

* Install additional fonts.

Seems to be needed to convert doc/images/iris.svg.

* Another missed example using figure number 0.

[doc build]
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.

4 participants