Set self._data_dtype in scale_and_set_data for CPU scaled textures#2601
Merged
brisvag merged 5 commits intovispy:mainfrom Jun 19, 2024
Merged
Set self._data_dtype in scale_and_set_data for CPU scaled textures#2601brisvag merged 5 commits intovispy:mainfrom
brisvag merged 5 commits intovispy:mainfrom
Conversation
brisvag
reviewed
Jun 17, 2024
Collaborator
brisvag
left a comment
There was a problem hiding this comment.
So, looking back at it:
- this should happen when the texture is first initialized with no data, resulting in
self._data_dtype == None - then, if new data is set via
scale_and_set_data, a new dtype is saved. However, before this PR, theself._data_dtyperemainsNone. - the next time data is set, if the data has a different dtype, things should get messed up because the conversion/clipping will go awry.
I tried to spin up a simple test but things are getting in the way and I don't have the time now to dive deeper, so if you do please take a stab!
Contributor
Author
|
@brisvag does this test make sense to you? Here is a failed run without the proposed change: |
brisvag
approved these changes
Jun 18, 2024
Collaborator
brisvag
left a comment
There was a problem hiding this comment.
Perfect! Thanks @aganders3 :)
Contributor
Author
|
Of course I left a bad debug print in there though. 🤦 I believe tests will pass now with b1692b4. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed this warning when running tests, and I think it traces back to the change in this PR.
See #2350 (comment) for some context.
I am partly guessing what this code meant to be doing, but here the
_data_dtypeis set the first timescale_and_set_datais called. @brisvag at your suggestion I am trying to think of a test that could have caught this, but need to think about it a little more.