napari / napari-animation

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

catch boolean interpolation earlier and change boolean interpolation behaviour #108

Closed JoOkuma closed 2 years ago

JoOkuma commented 2 years ago

The problem was that booleans are numbers and when converted back to booleans the transition would almost never happen.

The code presented in issue #106, now results in the following movie:

https://user-images.githubusercontent.com/21022743/135507750-03433b42-5063-4311-af36-2a0b15024575.mov

An additional improvement was done, now booleans do not interpolate, their change is done instantaneously.

@alisterburt I updated one of the tests. I'm not sure if the interpolate_bool is still an appropriate function name, I can change if you have any suggestion.

JoOkuma commented 2 years ago

It might be interesting to add an additional test similar to the code from the original issue, checking the state of the keyframes.

I can do that in the following weeks if you guys think it's a good idea.

alisterburt commented 2 years ago

@JoOkuma re: the test! Yes that would definitely be useful to catch any regressions, in general this repo is not as well tested as it should be 🙂

codecov[bot] commented 2 years ago

Codecov Report

Merging #108 (0de8596) into main (07f93c7) will increase coverage by 0.03%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #108      +/-   ##
==========================================
+ Coverage   84.91%   84.94%   +0.03%     
==========================================
  Files          21       21              
  Lines         928      930       +2     
==========================================
+ Hits          788      790       +2     
  Misses        140      140              
Impacted Files Coverage Δ
napari_animation/_tests/test_interpolation.py 100.00% <100.00%> (ø)
napari_animation/interpolation.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 07f93c7...0de8596. Read the comment docs.

alisterburt commented 2 years ago

not worried about the error here, seems internal napari only! merging now, thanks for the PR!!