napari / napari-animation

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

[bugfix] coerce as_layer_data_tuple from DeprecatingDict to dict for internal use #229

Closed psobolewskiPhD closed 2 months ago

psobolewskiPhD commented 2 months ago

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

As of https://github.com/napari/napari/pull/6976 (0.5.0) as_layer_data_tuple doesn't return a dict anymore, but a _DeprecatingDict. This means that the checks that use isinstance(foo, dict) in ViewerState and in interpolation.utils fail.

This PR coerces the output of as_layer_data_tuple in ViewerState to avoid this issue. The alternative would be to change the checks for dict to MutableMapping or such.

See: https://napari.zulipchat.com/#narrow/stream/212875-general/topic/DeprecatingDict.20not.20accepted.20in.20LayerDataTuple

psobolewskiPhD commented 2 months ago

Test fail is due to missing test dependency. I'm trying to fix it here: https://github.com/napari/napari-animation/pull/230

Edit: new fails are due to another napari change as far as I can tell: https://github.com/napari/napari-animation/issues/231

alisterburt commented 2 months ago

Remaining issues fixed by @Czaki - thanks both of you for sorting this so quickly!