Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
removed test_image_cursor_formatting()#30465
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
dstansby merged 1 commit intomatplotlib:mainfromtrygvrad:remove-test_image_cursor_formattingSep 4, 2025
Merged
removed test_image_cursor_formatting()#30465
dstansby merged 1 commit intomatplotlib:mainfromtrygvrad:remove-test_image_cursor_formattingSep 4, 2025
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
This test does not test im.format_cursor_data() because it test it with 1d arrays, whereas the artist.format_cursor_data() should forward to colrizingArtist._format_cursor_data_override() but this only happens with 0d data. The correct behavior with nans is tested in the existing test test_format_cursor_data(), so the test removed here, even if working as intended, is superfluous.
QuLogic approved these changesSep 4, 2025
dstansby approved these changesSep 4, 2025
553cec1 intomatplotlib:main 39 checks passed
Uh oh!
There was an error while loading.Please reload this page.
Sign up for freeto 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.
Test not working as intended
The test
test_image.test_image_cursor_formatting()is intended to test mouseover formatting of masked image data.see issue#15103 and resolution in PR#15140 .
However, this test does not work as intended, because it
Artist.format_cursor_data()will in normal circumstances call_ColorizerInterface._format_cursor_data_override():However, because of the way
test_image_cursor_formatting()is implemented the array sent toim.format_cursor_data()is 1d, and_format_cursor_data_override()is therefore not called.i.e. this test does not test the formatting of masked image data as intended.
The relevant behavior has another test
The relevant test (
test_image.test_image_cursor_formatting()) is 6 years old. Since then, a more comprehensive test forim.format_cursor_data()has been developed, reproduced below.This tests
im.format_cursor_data()with masked values (nan), and I therefore believe it is not necessary to adapttest_image.test_image_cursor_formatting()so that it tests the relevant behavior, andim.format_cursor_data()can instead be removed.Why did this attract my attention
I noticed this because I am adapting
_format_cursor_data_override()to work with multivariate data, see#29876 and related PRs, and need to develop new tests for this behavior. I attempted to base my tests ontest_image.test_image_cursor_formatting()but this proved futile, and I will instead implement tests based ontest_image.test_format_cursor_data().