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

Skip to content

De-randomize doc builds #5769

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 7 commits into from
Jan 5, 2016
Merged

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Dec 31, 2015

Based on some issues I've found trying to get consistency out of #5743, this disables some needless randomness in the documentation (by setting seeds, or dropping it altogether). There are still a few things that remain:

  • The hash in the inheritance diagrams changes; I guess this is a "bug" in the Sphinx extension, but I have not really looked much deeper.
  • There are some dictionaries in attributes and/or default parameters that don't stay sorted. I would assume that's also deep in Sphinx and I can't do anything about it.
  • Something is weird with the size of the background of the labels in boxplot_demo2.py; I guess the font size and bbox calculation are not always done in the same order.
  • The location of some tick marks is ever so slightly different in 41 images (including thumbnails and duplicates, so not quite so many actual examples.) I don't know why this is, maybe rounding differences?

@QuLogic QuLogic added this to the next major release (2.0) milestone Dec 31, 2015
@jenshnielsen
Copy link
Member

👍

I think this fails due to the issue fixed by #5770

@mdboom
Copy link
Member

mdboom commented Dec 31, 2015

Cool. This is very welcome work.

The hash in the inheritance diagrams changes; I guess this is a "bug" in the Sphinx extension, but I have not really looked much deeper.

Looking at the code, nothing obvious leaps out as to why this would be the case... As an experiment, you could try monkey-patching the hash function in sphinx.ext.inheritance_diagram.get_graph_hash to forcibly sort or otherwise normalize the stuff that goes into the hash (and then make a PR against Sphinx if successful -- I'm not suggesting monkey patching it as a matter of course from matplotlib).

There are some dictionaries in attributes and/or default parameters that don't stay sorted. I would assume that's also deep in Sphinx and I can't do anything about it.

If you can reduce this to a simple standalone example where the attributes don't always come out in order, I suspect the Sphinx folks would be amenable to fixing it.

Something is weird with the size of the background of the labels in boxplot_demo2.py; I guess the font size and bbox calculation are not always done in the same order.

I can certainly reproduce this one. I might spend a little time looking.

The location of some tick marks is ever so slightly different in 41 images (including thumbnails and duplicates, so not quite so many actual examples.) I don't know why this is, maybe rounding differences?

Which ones? I wonder if this is due to something not quite right in the recent limits changes or possibly something like #5767

@QuLogic
Copy link
Member Author

QuLogic commented Jan 1, 2016

Inheritance diagrams should be fixed by sphinx-doc/sphinx#2210.

@QuLogic
Copy link
Member Author

QuLogic commented Jan 1, 2016

Which ones? I wonder if this is due to something not quite right in the recent limits changes or possibly something like #5767

I don't know how these few always come out different somehow, but

  • build/html/_images/demo_axis_direction.png
  • build/html/_images/demo_axisline_style.png
  • build/html/_images/demo_curvelinear_grid1.png
  • build/html/_images/demo_curvelinear_grid.png
  • build/html/_images/demo_floating_axes1.png
  • build/html/_images/demo_floating_axes.png
  • build/html/_images/demo_floating_axis1.png
  • build/html/_images/demo_floating_axis.png
  • build/html/_images/parasite_simple21.png
  • build/html/_images/parasite_simple2.png
  • build/html/_images/simple_axis_direction01.png
  • build/html/_images/whats_new_99_axes_grid.png
    plus whatever other copies of these there are.

I was thinking more of #5647, though.

@QuLogic
Copy link
Member Author

QuLogic commented Jan 2, 2016

Looks like this is passing again with the rebase; I think it can go in if there are no other issues and we can leave the other stuff for other PRs.

@@ -16,6 +16,7 @@
randomDists = ['Normal(1,1)', ' Lognormal(1,1)', 'Exp(1)', 'Gumbel(6,4)',
'Triangular(2,9,11)']
N = 500
np.random.seed(0)
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest adding a comment that the random seeding is only to make the example reproducible

Copy link
Member Author

Choose a reason for hiding this comment

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

There are many of these in the examples without any comment; add them as well?

Copy link
Member

Choose a reason for hiding this comment

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

There are many issues with the examples so I wouldn't expect to fix all of them but I would like to do this in new examples

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@jenshnielsen
Copy link
Member

A few inline comments otherwise 👍 I agree that leaving the other stuff for a subsequent PR is fine.

Looks like the examples that list above are mainly in the mpl_toolkits axes_grid1 and axisartist.
Any change to these may conflict with #5752 which moves these around a bit

@tacaswell
Copy link
Member

@QuLogic If you can address the few line comments we can get this merged. #5752 needs a rebase already so lets get this one in so we can move forward on #5752 and #5743.

If you need to install sphinx from your repo to get that fix.

@mdboom
Copy link
Member

mdboom commented Jan 4, 2016

If you need to install sphinx from your repo to get that fix.

That's fine as long as we remember to rebase that against upstream Sphinx periodically. While I'm normally against monkey-patching, in this case I think I'd prefer monkey patching those two small methods in Sphinx because it places less burden to keep up with Sphinx.

@QuLogic
Copy link
Member Author

QuLogic commented Jan 5, 2016

If you need to install sphinx from your repo to get that fix.

Nah, I don't think that's necessary; it only ensures that consecutive builds give consistent names, but it won't make too much difference to the results.

jenshnielsen added a commit that referenced this pull request Jan 5, 2016
@jenshnielsen jenshnielsen merged commit 1d89de2 into matplotlib:v2.x Jan 5, 2016
@jenshnielsen
Copy link
Member

Thanks. We can always fix the examples later then if there are several others with the same issue

@QuLogic QuLogic deleted the non-random-docs branch January 5, 2016 07:49
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.

4 participants