Commit bcd80d5
committed
refactor(color): simplify the continuous-fill block and align idioms (#700)
/simplify pass (behaviour-preserving):
- continuous-reprocessing: drop the duplicated NaN-count warning across the
try/except arms — coerce, then count once via pd.isna and warn once.
- has_valid_color: build the distinct-colors set once instead of twice.
- _add_legend_and_colorbar: branch on color_spec.is_categorical instead of
duck-typing `source is not None and hasattr(remove_unused_categories)`.
- to_rgba: use the module-level colors.to_rgba_array (matching _map_color_seg)
instead of instantiating ColorConverter(); drop the now-unused import.1 parent f79a1c8 commit bcd80d5
2 files changed
Lines changed: 13 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
727 | 726 | | |
728 | 727 | | |
729 | 728 | | |
730 | | - | |
| 729 | + | |
731 | 730 | | |
732 | 731 | | |
733 | | - | |
| 732 | + | |
734 | 733 | | |
735 | 734 | | |
736 | 735 | | |
| |||
748 | 747 | | |
749 | 748 | | |
750 | 749 | | |
751 | | - | |
| 750 | + | |
752 | 751 | | |
753 | 752 | | |
754 | 753 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
| 365 | + | |
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| |||
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
693 | | - | |
694 | 693 | | |
695 | 694 | | |
696 | 695 | | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | 696 | | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
711 | 703 | | |
712 | 704 | | |
713 | 705 | | |
714 | 706 | | |
| 707 | + | |
715 | 708 | | |
716 | | - | |
717 | | - | |
| 709 | + | |
| 710 | + | |
718 | 711 | | |
719 | 712 | | |
720 | 713 | | |
| |||
0 commit comments