Closed Czaki closed 11 months ago
Doiesn't fully solve these issue, right? If you have 2 keyframes and opacity goes from 1 to 2 and they're both integers, you'll get a flip in the middle no?
No. This will still return int (so 1 or 2 in this case). There are scenarios when interpolating int should return int (for example for 0, 100, and fraction 0.5 the result should be 50, not 50.0).
Yes, but 1 and 2 from a "float" field should return 1.5 at fraction 0.75, not 1. My point being, we should still enforce types in napari.
Yes, but 1 and 2 from a "float" field should return 1.5 at fraction 0.75, not 1. My point being, we should still enforce types in napari.
I totally agree. This is only a fix to reduce the probability of the problem. As it may be hard to find every place that needs coerce and ensure that any future PR will not introduce new problematic property.
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
23c1a3c
) 85.91% compared to head (40518ab
) 86.06%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR changes
interpolate_num
behaviour to fallback to float like a number if the first argument is Interger and the second one is Real.closes #149 closes #152