-
Notifications
You must be signed in to change notification settings - Fork 26
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
sphinx-autobuild becomes slow #82
Comments
I tried to speed up local builds using the only directive but it didn't seem to prevent the execution of the code in the only directive when not a draft. Here is the revert: |
The matplotlib |
You mean for animations? |
This issue has to do with sphinx and jupyter-sphinx, which you are presumably not using. |
I opened this issue on jupyter-sphinx: jupyter/jupyter-sphinx#219 |
One way to probably reduce the time of these calls is to down sample the simulation data to the frames per second desired, then pass to the animation. The animation probably generates an image for every time stamp and then down samples before displaying to get the right frames per second. |
No, I definitely do not use this! :-) |
I tried setting the frame format on the writer directly to see if it would produce an svg (and maybe be faster) for animations but it seems to still generate pngs. I think the only way to speed up the animation generation from matplotlib is to reduce frames per second or reduce duration. For the 10 second nonholonomic animation, going to 10 fps makes it choppy, but 20 is fine. Here was the writer code: #HTML(ani.to_jshtml(fps=fps))
from pathlib import Path
from matplotlib.animation import HTMLWriter
path = Path("temp.html")
writer = HTMLWriter(fps=fps,
embed_frames=True)
writer.frame_format = 'png'
ani.save(str(path), writer=writer)
HTML(path.read_text()) |
I've added a new way to just run builds for a single chapter using an environment variable here: b9f119d This makes building much faster and solves the issue for me iterating locally on the books. |
I've opened the issue on jupyter-sphinx and have a local workaround, so closing this. |
In general, the sphinx caching mechanism works well with sphinx-autobuild but if an error occurs in a
jupyter-execute
cell on a build, then the cache seems to be invalidated causing all of the pages to be rebuilt. This makes the edit review cycle too slow once many rst files that each take a long time to compute are present.The text was updated successfully, but these errors were encountered: