Commit fe4b36b
committed
Fix format_cursor_data with nans.
Without this fix, hovering the mouse over a nan pixel in an imshow()
would result in `Warning: converting a masked element to nan.` and then
`ValueError: cannot convert float NaN to integer`. Fix that.
The format_cursor_data test doesn't explicitly check the return value
of get_cursor_data anymore because np.ma.masked is returned for nan
inputs (this is expected from the general approach for handling invalid
data); checking that format_cursor_data gives the right string is
sufficient.1 parent a35f108 commit fe4b36b
2 files changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1273 | 1273 | | |
1274 | 1274 | | |
1275 | 1275 | | |
| 1276 | + | |
| 1277 | + | |
1276 | 1278 | | |
1277 | 1279 | | |
1278 | 1280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| 343 | + | |
343 | 344 | | |
344 | 345 | | |
345 | 346 | | |
| |||
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
352 | | - | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| |||
0 commit comments