Commit e9fa13a
committed
fix(imshow): validate slots so bad assignments raise a clear error
Two slot assignments reached px.imshow and crashed inside its own
slicing with an error that named nothing the caller had written:
- The same dimension in two slots popped the same index twice, giving
"IndexError: pop index out of range".
- Facet and animation slots consuming all but one dimension left nothing
for the second heatmap axis, giving "IndexError: list index out of
range". Duplicates that reached the transpose first surfaced as
"ValueError: axes don't match array" instead.
Validate the assignment before transposing: every slot needs its own
dimension, and both y and x must be filled. The error now names the
dimension and the two slots that want it, or the slots that consumed
the axes.
Sweeping all 3125 combinations of auto/None/each dimension across the
five slots of a 4D array: every one now either builds a figure or
raises a ValueError that says what to change, with no change to the
1056 combinations that already worked.
Also drop mypy's python_version = "3.10" pin, which failed CI on the
3.12 and 3.13 matrix entries -- numpy's stubs now use `type` statements
that mypy rejects when targeting 3.10. Reproduced on origin/main with
no other changes. Unpinned, mypy targets the interpreter it runs under,
so each matrix entry checks its own version against the numpy stubs
resolved for it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKhPQzJgQr7khmzDPYAXA91 parent 4c3e586 commit e9fa13a
3 files changed
Lines changed: 93 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
550 | 595 | | |
551 | 596 | | |
552 | 597 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
671 | 671 | | |
672 | 672 | | |
673 | 673 | | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
674 | 717 | | |
675 | 718 | | |
676 | 719 | | |
| |||
788 | 831 | | |
789 | 832 | | |
790 | 833 | | |
| 834 | + | |
| 835 | + | |
791 | 836 | | |
792 | 837 | | |
793 | 838 | | |
| |||
0 commit comments