phylustrator 0.2.0__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {phylustrator-0.2.0/src/phylustrator.egg-info → phylustrator-0.2.2}/PKG-INFO +1 -1
- {phylustrator-0.2.0 → phylustrator-0.2.2}/pyproject.toml +1 -1
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/color.py +18 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2/src/phylustrator.egg-info}/PKG-INFO +1 -1
- {phylustrator-0.2.0 → phylustrator-0.2.2}/tests/test_figure.py +15 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/LICENSE +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/README.md +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/setup.cfg +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/__init__.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/__main__.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/cli.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/compose.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/genomes/__init__.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/genomes/figure.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/genomes/genome.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/genomes/io.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/genomes/layers/__init__.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/genomes/layers/genes.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/genomes/layers/guides.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/genomes/layers/highlight.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/genomes/layers/synteny.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/genomes/layout.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/genomes/matrix.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/genomes/panels.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/genomes/track.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/render.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/style.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/trees/__init__.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/trees/figure.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/trees/io.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/trees/layers/__init__.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/trees/layers/clades.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/trees/layers/coloring.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/trees/layers/events.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/trees/layers/guides.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/trees/layers/labels.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/trees/layers/tracks.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/trees/layout.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/trees/skeleton.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/trees/tree.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator/zombi.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator.egg-info/SOURCES.txt +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator.egg-info/dependency_links.txt +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator.egg-info/entry_points.txt +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator.egg-info/requires.txt +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/src/phylustrator.egg-info/top_level.txt +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/tests/test_cli.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/tests/test_genomes.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/tests/test_io.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/tests/test_layout.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/tests/test_tree.py +0 -0
- {phylustrator-0.2.0 → phylustrator-0.2.2}/tests/test_version.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "phylustrator"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
8
|
description = "A composable plotter for evolutionary figures: phylogenetic trees, genomes, synteny and alignments"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -14,6 +14,24 @@ from typing import Callable, Iterable
|
|
|
14
14
|
# figure that shows two characters at once needs two maps that cannot be mistaken for each other,
|
|
15
15
|
# which is why more than one sequential map is here.
|
|
16
16
|
_COLORMAPS: dict[str, list[tuple[int, int, int]]] = {
|
|
17
|
+
# magma stopped before it goes pale, the same trade as `viridis_dark` below in a different hue.
|
|
18
|
+
# Two line-safe ramps, not one, because a figure that shows two different quantities beside each
|
|
19
|
+
# other needs them to look different — one ramp used twice reads as one quantity shown twice.
|
|
20
|
+
"magma_dark": [
|
|
21
|
+
(0, 0, 4), (11, 9, 36), (32, 17, 75), (59, 15, 112),
|
|
22
|
+
(87, 21, 126), (114, 31, 129), (140, 41, 129), (168, 50, 125),
|
|
23
|
+
(196, 60, 117), (222, 73, 104), (241, 96, 93), (250, 127, 94),
|
|
24
|
+
],
|
|
25
|
+
# viridis stopped before it goes pale. A sequential ramp on a *line* has a problem a heatmap does
|
|
26
|
+
# not: the light end of every perceptually-uniform map (viridis 222, magma 248, cividis 224 in
|
|
27
|
+
# luminance) vanishes against white at a few pixels wide, so the values that land there are
|
|
28
|
+
# invisible rather than merely faint. This keeps viridis's order and spacing and stops at its last
|
|
29
|
+
# clearly-drawn green, which costs a little range and makes every value readable.
|
|
30
|
+
"viridis_dark": [
|
|
31
|
+
(68, 1, 84), (72, 26, 108), (71, 47, 125), (65, 68, 135),
|
|
32
|
+
(57, 86, 140), (49, 104, 142), (42, 120, 142), (35, 136, 142),
|
|
33
|
+
(31, 152, 139), (34, 168, 132), (53, 183, 121), (84, 197, 104),
|
|
34
|
+
],
|
|
17
35
|
"viridis": [
|
|
18
36
|
(68, 1, 84), (72, 26, 108), (71, 47, 125), (65, 68, 135),
|
|
19
37
|
(57, 86, 140), (49, 104, 142), (42, 120, 142), (35, 136, 142),
|
|
@@ -106,3 +106,18 @@ def test_color_history_limits_fix_the_scale_across_panels():
|
|
|
106
106
|
own = (plot(tree) + color_history(narrow)).as_svg()
|
|
107
107
|
fixed = (plot(tree) + color_history(narrow, limits=(0.0, 1.0))).as_svg()
|
|
108
108
|
assert own != fixed
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def test_a_line_safe_colormap_never_goes_pale():
|
|
112
|
+
"""Every perceptually-uniform sequential map ends near-white, which is fine for a heatmap and not
|
|
113
|
+
for a branch a few pixels wide: the values at that end vanish instead of being faint."""
|
|
114
|
+
from phylustrator.color import colormap_hex
|
|
115
|
+
|
|
116
|
+
def luminance(hex_colour):
|
|
117
|
+
r, g, b = (int(hex_colour[i:i + 2], 16) for i in (1, 3, 5))
|
|
118
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b
|
|
119
|
+
|
|
120
|
+
for pale, safe in (("viridis", "viridis_dark"), ("magma", "magma_dark")):
|
|
121
|
+
assert max(luminance(c) for c in colormap_hex(pale)) > 200 # the problem
|
|
122
|
+
assert max(luminance(c) for c in colormap_hex(safe)) < 180 # the fix
|
|
123
|
+
assert colormap_hex(safe)[0] == colormap_hex(pale)[0] # same dark end, same order
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|