napari / napari-animation

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

Handle namedtuple #175

Closed brisvag closed 1 year ago

brisvag commented 1 year ago

On the current napari main, Dims.range is a NamedTuple. This break napari-animation because namedtuples want arguments separately, rather than as a single iterable. This PR adds a fallback for when the current behaviour fails.

We could check types instead of using exceptions for control flow, but things get complicated with generics, so I ended up with this instead.

brisvag commented 1 year ago

Done! I made it also a mixed-type test just to make sure that works as well :P

codecov[bot] commented 1 year ago

Codecov Report

Merging #175 (f5987f1) into main (17858a4) will increase coverage by 0.23%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #175      +/-   ##
==========================================
+ Coverage   85.91%   86.15%   +0.23%     
==========================================
  Files          26       26              
  Lines         994     1011      +17     
==========================================
+ Hits          854      871      +17     
  Misses        140      140              
Impacted Files Coverage Δ
napari_animation/_tests/test_interpolation.py 100.00% <100.00%> (ø)
...pari_animation/interpolation/base_interpolation.py 100.00% <100.00%> (ø)
alisterburt commented 1 year ago

https://github.com/napari/napari-animation/actions/runs/5081045936