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 copy/paste of points #5795
Fix copy/paste of points #5795
Conversation
I'm a bit confused, can you explain the change to test? |
Sorry, the implementation comment in the test is not clear. Does the following help?
By trying to copy at an index of 4, we reproduce the bug in #5786, which is caused by the combination of two things. 1. Style encodings share the same code to handle scalar style values (e.g. strings) and non-scalar ones (e.g. RGBA colors). In the long term, I wonder if (2) is really worth it, since that is the major cause here and I think vispy will end up storing an array of RGBA color values anyway. |
ok, makes sense; yeah vispy ends up with rgba, so it's definitely fine to not special-case, but no need to do it here :P |
@brisvag: since you've already taken a look and this is small, do you mind reviewing? I updated the explanatory comment in the test as above. |
Codecov Report
@@ Coverage Diff @@
## main #5795 +/- ##
==========================================
+ Coverage 89.79% 89.87% +0.08%
==========================================
Files 614 614
Lines 52196 52196
==========================================
+ Hits 46870 46913 +43
+ Misses 5326 5283 -43
|
# Fixes/Closes Closes #5786 # Description The issue here is actually caused by copying constant color values used for text, which causes issues because a single value has `ndim > 0`. This PR fixes the issue by specifying the dimensionality of a single color value when copying values. It might be worth reconsidering the implementation here and/or whether constant encodings are worth handling as a specific optimized case like this. But I think it's worth getting this PR in before a longer consideration. ## Type of change - [x] Bug-fix (non-breaking change which fixes an issue) # How has this been tested? - [x] modified an existing test to reproduce the bug, then fixed it - [x] all other tests pass with my change - manually tested this by copying and pasting lots of points
# Fixes/Closes Closes #5786 # Description The issue here is actually caused by copying constant color values used for text, which causes issues because a single value has `ndim > 0`. This PR fixes the issue by specifying the dimensionality of a single color value when copying values. It might be worth reconsidering the implementation here and/or whether constant encodings are worth handling as a specific optimized case like this. But I think it's worth getting this PR in before a longer consideration. ## Type of change - [x] Bug-fix (non-breaking change which fixes an issue) # How has this been tested? - [x] modified an existing test to reproduce the bug, then fixed it - [x] all other tests pass with my change - manually tested this by copying and pasting lots of points
# Fixes/Closes Closes #5786 # Description The issue here is actually caused by copying constant color values used for text, which causes issues because a single value has `ndim > 0`. This PR fixes the issue by specifying the dimensionality of a single color value when copying values. It might be worth reconsidering the implementation here and/or whether constant encodings are worth handling as a specific optimized case like this. But I think it's worth getting this PR in before a longer consideration. ## Type of change - [x] Bug-fix (non-breaking change which fixes an issue) # How has this been tested? - [x] modified an existing test to reproduce the bug, then fixed it - [x] all other tests pass with my change - manually tested this by copying and pasting lots of points
# Fixes/Closes Closes #5786 # Description The issue here is actually caused by copying constant color values used for text, which causes issues because a single value has `ndim > 0`. This PR fixes the issue by specifying the dimensionality of a single color value when copying values. It might be worth reconsidering the implementation here and/or whether constant encodings are worth handling as a specific optimized case like this. But I think it's worth getting this PR in before a longer consideration. ## Type of change - [x] Bug-fix (non-breaking change which fixes an issue) # How has this been tested? - [x] modified an existing test to reproduce the bug, then fixed it - [x] all other tests pass with my change - manually tested this by copying and pasting lots of points
Fixes/Closes
Closes #5786
Description
The issue here is actually caused by copying constant color values used for text, which causes issues because a single value has
ndim > 0
. This PR fixes the issue by specifying the dimensionality of a single color value when copying values.It might be worth reconsidering the implementation here and/or whether constant encodings are worth handling as a specific optimized case like this. But I think it's worth getting this PR in before a longer consideration.
Type of change
How has this been tested?