Repository navigation
Show a square grid in the Learner2D README GIF, render the animations on Read the Docs - #503
Merged
Merged
Conversation
…E GIF The "Homogeneous" panel used a Learner2D with uniform_loss, which gives an irregular triangulation rather than a grid. It now evaluates the function on a k × k square grid, draws the grid lines, and steps through k = 2..40 so both panels always use exactly k² points.
The GIFs and the animated logo are build artifacts of docs/make_animations.py, and every refresh added megabytes to the history. The Read the Docs build now renders them (ffmpeg from apt, Chrome for kaleido from plotly_get_chrome), in parallel with the notebooks, and the README links to the copies on adaptive.readthedocs.io, like it already does for the logo. make_animations.py renders each animation in its own process, so the slow LearnerND render overlaps the others.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Square grid as the homogeneous baseline
The "Homogeneous" panel of the Learner2D animation was a
Learner2Drun withuniform_loss. That produces an irregular triangulation of roughly equal-sized triangles, not a grid, which made the comparison confusing.The panel now shows the function evaluated on a k × k square grid, with the grid lines drawn so the grid is obvious.
_square_grid()helper indocs/make_animations.pyshades the grid withpcolormesh(shading="gouraud")and draws white grid lines (same style as the triangle edges on the adaptive side).Animations are no longer version controlled
The three README GIFs and
logo_docs.webmare build artifacts ofdocs/make_animations.py, and every refresh added megabytes to the history (this GIF alone grows from 0.81 MB to 1.36 MB, since the whole grid changes every frame).docs/.gitignore.readthedocs.ymlinstallsffmpeg(apt_packages) and Chrome for kaleido (plotly_get_chrome -y), and runsmake_animations.pyin the background whilebuild_notebooks.pyruns.... & build_notebooks.py && wait $!fails the build if either fails.make_animations.pyrenders each animation in its own process, so the slow LearnerND render (~143 s locally) overlaps the others.https://adaptive.readthedocs.io/en/latest/_static/readme/, like it already does for the logo. No release links to the oldraw.githubusercontent.com/.../mainURLs (the last release, v1.5.2, predates them).Trade-offs: the README images now depend on the
latestRead the Docs build (a failed build keeps serving the previous one), and a localzensical serveshows the animations only after runningmake_animations.pyonce (noted in the README).Preview of the new GIF from this PR's docs build: https://adaptive--503.org.readthedocs.build/en/503/_static/readme/learner2d.gif
Test plan
pre-commit runpasses on the changed files (ruff, ruff-format, mypy)readthedocs.ymlinstall and build commands inreadthedocs/build:ubuntu-24.04-2026.10.21with--cpus 2: Chrome finds all its libraries, all four animations land in_site/_static/, and the combined animations + notebooks step took 682 s (whole build ≈ 745 s)/en/503/_static/