leanplot 1.1.0__tar.gz → 1.1.1__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.
- {leanplot-1.1.0 → leanplot-1.1.1}/PKG-INFO +1 -1
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot/core/colors/palette.py +1 -1
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot/tests/test_palette.py +15 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot.egg-info/PKG-INFO +1 -1
- {leanplot-1.1.0 → leanplot-1.1.1}/pyproject.toml +1 -1
- {leanplot-1.1.0 → leanplot-1.1.1}/LICENSE.txt +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/README.md +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot/__init__.py +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot/core/__init__.py +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot/core/bar.py +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot/core/colors/__init__.py +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot/core/double_y.py +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot/core/functions.py +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot/core/line.py +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot/core/mixin.py +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot/debug.py +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot/tests/__init__.py +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot/tests/test_line.py +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot/tests/test_mixin.py +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot.egg-info/SOURCES.txt +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot.egg-info/dependency_links.txt +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot.egg-info/requires.txt +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/leanplot.egg-info/top_level.txt +0 -0
- {leanplot-1.1.0 → leanplot-1.1.1}/setup.cfg +0 -0
|
@@ -68,7 +68,7 @@ class ColorPalette:
|
|
|
68
68
|
if self.categorial:
|
|
69
69
|
available_colors = colormap.colors
|
|
70
70
|
else:
|
|
71
|
-
available_colors = colormap.
|
|
71
|
+
available_colors = colormap.resampled(self.number_of_colors).colors
|
|
72
72
|
if self.number_of_colors > len(available_colors):
|
|
73
73
|
raise ValueError(
|
|
74
74
|
f"Requested {self.number_of_colors} colors, but colormap "
|
|
@@ -29,6 +29,21 @@ class TestColorPalette(TestCase):
|
|
|
29
29
|
color_palette = ColorPalette(categorial=True, reversed_colormap=False)
|
|
30
30
|
self.assertEqual(color_palette.colormap_name, "batlowS")
|
|
31
31
|
|
|
32
|
+
def test_resampling(self):
|
|
33
|
+
"""Verify that the reverse colormap works correctly."""
|
|
34
|
+
color_palette = ColorPalette(categorial=False, number_of_colors=6)
|
|
35
|
+
colors = color_palette.colors
|
|
36
|
+
self.assertEqual(len(colors), 6)
|
|
37
|
+
color_palette2 = ColorPalette(categorial=False, number_of_colors=10)
|
|
38
|
+
colors2 = color_palette2.colors
|
|
39
|
+
self.assertEqual(len(colors2), 10)
|
|
40
|
+
self.assertAlmostEqual(colors[0][0], colors2[0][0])
|
|
41
|
+
self.assertAlmostEqual(colors[0][1], colors2[0][1])
|
|
42
|
+
self.assertAlmostEqual(colors[0][2], colors2[0][2])
|
|
43
|
+
self.assertAlmostEqual(colors[-1][0], colors2[-1][0])
|
|
44
|
+
self.assertAlmostEqual(colors[-1][1], colors2[-1][1])
|
|
45
|
+
self.assertAlmostEqual(colors[-1][2], colors2[-1][2])
|
|
46
|
+
|
|
32
47
|
def test_colors_returns_requested_number_of_colors(self):
|
|
33
48
|
"""Verify that the colors property returns exactly number_of_colors entries."""
|
|
34
49
|
color_palette = ColorPalette(colormap_name="oslo", number_of_colors=6)
|
|
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
|