Skip to content

Commit b484ad7

Browse files
feat: add alternative order for tol colormaps (#89)
* feat: add alternative order for tol colormaps * fix: ruff rule select code * style(pre-commit.ci): auto fixes [...] --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 6483fac commit b484ad7

File tree

3 files changed

+45
-4
lines changed

3 files changed

+45
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ select = [
110110
"ISC", # implicit-str-concat
111111
"TID", # tidy-imports
112112
"RUF", # ruff-specific rules
113-
"TCH", # flake8-type-checking
113+
"TC", # flake8-type-checking
114114
"TID", # flake8-tidy-imports
115115
]
116116
ignore = [

src/cmap/data/tol/__init__.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
Paul Tol is a Dutch instrument scientist with a PhD in atomic physics,
44
working on the TROPOMI, SPEXone and TANGO projects in the Earth programme of SRON.
55
6-
https://personal.sron.nl/~pault/
7-
https://personal.sron.nl/~pault/data/tol_colors.py
8-
https://personal.sron.nl/~pault/data/colourschemes.pdf
6+
https://sronpersonalpages.nl/~pault/
7+
https://sronpersonalpages.nl/~pault/data/tol_colors.py
8+
https://sronpersonalpages.nl/~pault/data/colourschemes.pdf
99
1010
Copyright:
1111
@@ -364,13 +364,16 @@ def _inject_rainbow_discrete() -> None:
364364
(187, 187, 187), # "#BBBBBB"
365365
]
366366

367+
bright_alt = [bright[i] for i in [0, 4, 2, 3, 1, 5, 6]]
367368

368369
high_contrast = [
369370
(221, 170, 51), # "#DDAA33",
370371
(187, 85, 102), # "#BB5566",
371372
(0, 68, 136), # "#004488",
372373
]
373374

375+
high_contrast_alt = [high_contrast[i] for i in [2, 0, 1]]
376+
374377
vibrant = [
375378
(0, 119, 187), # "#0077BB"
376379
(51, 187, 238), # "#33BBEE"
@@ -381,6 +384,8 @@ def _inject_rainbow_discrete() -> None:
381384
(187, 187, 187), # "#BBBBBB"
382385
]
383386

387+
vibrant_alt = [vibrant[i] for i in [3, 0, 1, 5, 4, 2, 6]]
388+
384389
muted = [
385390
(51, 34, 136), # "#332288"
386391
(136, 204, 238), # "#88CCEE"
@@ -393,6 +398,8 @@ def _inject_rainbow_discrete() -> None:
393398
(170, 68, 153), # "#AA4499"
394399
]
395400

401+
muted_alt = [muted[i] for i in [6, 0, 5, 3, 1, 7, 2, 4, 8]]
402+
396403
medium_contrast = [
397404
(238, 204, 102), # "#EECC66"
398405
(238, 153, 170), # "#EE99AA"
@@ -402,6 +409,8 @@ def _inject_rainbow_discrete() -> None:
402409
(0, 68, 136), # "#004488"
403410
]
404411

412+
medium_contrast_alt = [medium_contrast[i] for i in [2, 5, 0, 4, 3, 1]]
413+
405414
pale = [
406415
(187, 204, 238), # "#BBCCEE"
407416
(204, 238, 255), # "#CCEEFF"
@@ -431,3 +440,5 @@ def _inject_rainbow_discrete() -> None:
431440
(255, 170, 187), # "#FFAABB"
432441
(221, 221, 221), # "#DDDDDD"
433442
]
443+
444+
light_alt = [light[i] for i in [0, 6, 5, 7, 1, 2, 3, 4, 8]]

src/cmap/data/tol/record.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
"data": "cmap.data.tol:bright",
4040
"interpolation": false
4141
},
42+
"bright-alt": {
43+
"category": "qualitative",
44+
"data": "cmap.data.tol:bright_alt",
45+
"interpolation": false
46+
},
4247
"dark": {
4348
"category": "qualitative",
4449
"data": "cmap.data.tol:dark",
@@ -49,6 +54,11 @@
4954
"data": "cmap.data.tol:high_contrast",
5055
"interpolation": false
5156
},
57+
"high-contrast-alt": {
58+
"category": "qualitative",
59+
"data": "cmap.data.tol:high_contrast_alt",
60+
"interpolation": false
61+
},
5262
"incandescent": {
5363
"category": "sequential",
5464
"data": "cmap.data.tol:incandescent"
@@ -62,16 +72,31 @@
6272
"data": "cmap.data.tol:light",
6373
"interpolation": false
6474
},
75+
"light-alt": {
76+
"category": "qualitative",
77+
"data": "cmap.data.tol:light_alt",
78+
"interpolation": false
79+
},
6580
"medium-contrast": {
6681
"category": "qualitative",
6782
"data": "cmap.data.tol:medium_contrast",
6883
"interpolation": false
6984
},
85+
"medium-contrast-alt": {
86+
"category": "qualitative",
87+
"data": "cmap.data.tol:medium_contrast_alt",
88+
"interpolation": false
89+
},
7090
"muted": {
7191
"category": "qualitative",
7292
"data": "cmap.data.tol:muted",
7393
"interpolation": false
7494
},
95+
"muted-alt": {
96+
"category": "qualitative",
97+
"data": "cmap.data.tol:muted_alt",
98+
"interpolation": false
99+
},
75100
"nightfall": {
76101
"category": "diverging",
77102
"data": "cmap.data.tol:nightfall"
@@ -230,6 +255,11 @@
230255
"category": "qualitative",
231256
"data": "cmap.data.tol:vibrant",
232257
"interpolation": false
258+
},
259+
"vibrant-alt": {
260+
"category": "qualitative",
261+
"data": "cmap.data.tol:vibrant_alt",
262+
"interpolation": false
233263
}
234264
},
235265
"license": "BSD-3-Clause",

0 commit comments

Comments
 (0)