napari / napari-animation

A napari plugin for making animations
https://napari.github.io/napari-animation/
Other
74 stars 27 forks source link

Easily display video output in jupyter notebooks #170

Closed GenevieveBuckley closed 1 year ago

GenevieveBuckley commented 1 year ago

Closes https://github.com/napari/napari-animation/issues/147

This PR adds a _repr_html_ method to the Animation class, so that it will automatically display the video once the filename is known (i.e. after the animate method has been run).

Screen Shot 2023-05-01 at 5 11 16 pm

GenevieveBuckley commented 1 year ago

Note: I did try Alister's ipython_display suggestion, as well as _repr_html_, but that didn't actually work very well for me.

Perhaps this was because I was running jupyter lab instead of a jupyter notebook, but in any case I decided to go with the one that seemed more robust.

codecov[bot] commented 1 year ago

Codecov Report

Merging #170 (654ed21) into main (f506832) will decrease coverage by 0.31%. The diff coverage is 42.85%.

@@            Coverage Diff             @@
##             main     #170      +/-   ##
==========================================
- Coverage   85.84%   85.53%   -0.31%     
==========================================
  Files          26       26              
  Lines         975      982       +7     
==========================================
+ Hits          837      840       +3     
- Misses        138      142       +4     
Impacted Files Coverage Δ
napari_animation/animation.py 83.96% <42.85%> (-2.91%) :arrow_down:
alisterburt commented 1 year ago

awesome - thanks for the PR, this looks really great! My only question is whether this needs to be adjusted if an animation is saved as a .gif? Happy for this to be handled in followup though - will merge here :)

alisterburt commented 1 year ago

@GenevieveBuckley FYI I just pushed v0.0.6 which includes this :)