Repository navigation
Commit c8fe47f
feat: make the colormap config lever loud and documented (#509)
The `visualize/general.yaml -> colormap` key already reached every 2D figure,
but a typo'd or unknown value reverted silently to the bundled `autoarray`
colormap and the user never learned their setting was ignored.
- `_default_colormap()` now separates the two failure modes: an absent config
(no autonerves, no `colormap` key) still falls back quietly to `autoarray`,
while a value matplotlib cannot resolve raises a `ValueError` naming the
config key, the offending value, and how to fix it. The bare `except
Exception` is gone, replaced by `(KeyError, ConfigException)` / `ImportError`.
- `_conf_imshow_origin()` and `_conf_output_format()` get the same narrow
excepts; `imshow_origin` additionally rejects anything but `upper`/`lower`.
- `config/visualize/README.md` gains a "Changing the colormap" section: the
global config key, the per-figure `colormap=` argument, and the figures that
deliberately fix their colormap (array_overlay `Greys`, the weak-lensing
cyclic/diverging maps, the cluster and GUI maps).
- 11 new unit tests in `test_autoarray/plot/test_utils.py` cover the config
value, the quiet fallback, the loud failure, the per-figure override, and
that one config edit moves both an imaging figure and an inversion
reconstruction.
No public API changes; the config key and every `colormap=` argument keep
their existing names and defaults.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PXGHBFryzQZMFvAskHe9sQ1 parent 50cc3b2 commit c8fe47f
3 files changed
Lines changed: 372 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
901 | 901 | | |
902 | 902 | | |
903 | 903 | | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
904 | 908 | | |
905 | | - | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
906 | 934 | | |
907 | 935 | | |
908 | | - | |
909 | | - | |
| 936 | + | |
| 937 | + | |
910 | 938 | | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
911 | 945 | | |
912 | 946 | | |
| 947 | + | |
913 | 948 | | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
914 | 953 | | |
915 | 954 | | |
916 | 955 | | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
917 | 986 | | |
918 | | - | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
919 | 993 | | |
920 | 994 | | |
921 | | - | |
922 | | - | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
923 | 1002 | | |
924 | 1003 | | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
925 | 1013 | | |
926 | 1014 | | |
927 | | - | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
928 | 1022 | | |
929 | 1023 | | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
930 | 1029 | | |
931 | | - | |
| 1030 | + | |
932 | 1031 | | |
933 | 1032 | | |
934 | 1033 | | |
| |||
0 commit comments