Skip to content

ENH: make the generated documentation more reproducible#883

Merged
choldgraf merged 1 commit intoexecutablebooks:masterfrom
mitya57:reproducible-docs
Dec 23, 2024
Merged

ENH: make the generated documentation more reproducible#883
choldgraf merged 1 commit intoexecutablebooks:masterfrom
mitya57:reproducible-docs

Conversation

@mitya57
Copy link
Copy Markdown
Contributor

@mitya57 mitya57 commented Dec 22, 2024

I am packaging sphinx-book-theme for Debian, and one of our goals is to make the built packages reproducible. See https://reproducible-builds.org/ for details.

This pull request makes the following improvements:

  • Use static ID for tables generated by pandas. This removes the following diff:

    -<table id="T_08154" style="font-size: 10px">
    +<table id="T_afb07" style="font-size: 10px">

    We have only one table on the page, so we can just hardcode 1. Also, replace deprecated applymap with map.

  • Use plt.show() as the final statement of matplotlib blocks, to prevent repr of AxesImage being added to HTML, which causes this diff:

    -<matplotlib.image.AxesImage at 0x7fffddde12b0>
    +<matplotlib.image.AxesImage at 0x7f38706eade0>
  • Call np.random.seed(0) before using np.random.randn().

After these fixes there are still problems coming from Folium and from equation with automatic label, but I have found no good solution, so I will probably just patch them out in Debian.

Copy link
Copy Markdown
Member

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

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

This all looks reasonable to me - thanks for these improvements to make it a bit more deterministic!

@choldgraf choldgraf merged commit b363e5f into executablebooks:master Dec 23, 2024
@agoose77 agoose77 changed the title Make the generated documentation more reproducible ENH: make the generated documentation more reproducible Feb 20, 2025
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.

2 participants