-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix interpolation problem with ints #189
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just going to suggest something like this in the napari PR, but you beat me while lunching.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
@@ -1,3 +1,4 @@ | |||
*.swp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did this end up here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I edit these files using vim.
I know that I should have this in global gitingore, but I think we should have default configuration fits for most editors.
I could revert this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine by me to leave it in, but I think I already have this in my global ignore :P
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. |
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. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #189 +/- ##
==========================================
+ Coverage 85.91% 86.06% +0.14%
==========================================
Files 26 26
Lines 1051 1062 +11
==========================================
+ Hits 903 914 +11
Misses 148 148 ☔ View full report in Codecov by Sentry. |
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