ENH: Add support for FuncAnimation#687
Conversation
|
And here are our built docs: |
|
Bumping AppVeyor to 3.6 from 3.5. The matplotlib for 3.5 appears to be too old to support animations without bugs. 3.5 is already tested on Travis anyway, and we'll probably kill support soon anyway (EOL in August) so this seems like the easiest solution. |
choldgraf
left a comment
There was a problem hiding this comment.
You're a wizard Eric! 🧙
It looks quite nice to me - a few comments in there. The GIF even works in the thumbnail! So cool! https://1535-25860190-gh.circle-artifacts.com/0/rtd_html/auto_examples/index.html
sphinx_gallery/scrapers.py
Outdated
| # if it's the file thumbnail | ||
| fig = ani._fig | ||
| image_path_iterator = block_vars['image_path_iterator'] | ||
| img_fname = next(image_path_iterator).replace('.png', '.gif') |
There was a problem hiding this comment.
We should really relax the assumptions about .png extensions in the codebase :-)
There was a problem hiding this comment.
Someday probably :) But in the meantime, knowing it ends with png and .replaceing works okay
sphinx_gallery/scrapers.py
Outdated
| if ImageMagickWriter.isAvailable(): | ||
| writer = 'imagemagick' | ||
| else: | ||
| writer = None |
There was a problem hiding this comment.
Do we assume this will default to FFmpeg then? And if we know it's buggy, maybe we raise a warning here about this?
There was a problem hiding this comment.
I don't know enough about matplotlib to know what all the options are, or if FFmpeg can be fixed to work better than it did in my original testing. So I'd rather not emit a warning unless someone with expertise can comment.
|
LGTM but it's unfamiliar territory for me. |
Codecov Report
@@ Coverage Diff @@
## master #687 +/- ##
==========================================
+ Coverage 97.77% 97.79% +0.01%
==========================================
Files 31 32 +1
Lines 3288 3405 +117
==========================================
+ Hits 3215 3330 +115
- Misses 73 75 +2
Continue to review full report at Codecov.
|
|
@choldgraf feel free to merge if you're happy |
|
I'm happy! |
| thumb_size = gallery_conf['thumbnail_size'] | ||
| use_dpi = round( | ||
| min(t_s / f_s for t_s, f_s in zip(thumb_size, fig_size))) | ||
| # FFmpeg is buggy for GIFs |
There was a problem hiding this comment.
@dopplershift would you be up for making a quick PR to triage based on the LooseVersion of matplotlib which backend to use?
Closes #150.
@choldgraf @lucyleeow do you want to take a first look at these? Once you're happy I'll ping the folks from #150 to take a look. (Anyone else can feel free to comment as well, just don't want to spam everyone if this is still half-baked/experimental!) But at least it seems to work for MNE-Python:
They both show animations when built with this branch.