leanplot 1.0.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.0.0 → leanplot-1.1.1}/PKG-INFO +3 -3
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot/core/bar.py +2 -2
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot/core/colors/__init__.py +1 -1
- leanplot-1.0.0/leanplot/core/colors/categorical.py → leanplot-1.1.1/leanplot/core/colors/palette.py +34 -8
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot/core/double_y.py +6 -10
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot/core/functions.py +4 -1
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot/core/line.py +6 -2
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot/core/mixin.py +2 -2
- leanplot-1.1.1/leanplot/debug.py +28 -0
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot/tests/test_mixin.py +3 -1
- leanplot-1.0.0/leanplot/tests/test_categorical.py → leanplot-1.1.1/leanplot/tests/test_palette.py +37 -12
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot.egg-info/PKG-INFO +3 -3
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot.egg-info/SOURCES.txt +4 -3
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot.egg-info/requires.txt +1 -1
- {leanplot-1.0.0 → leanplot-1.1.1}/pyproject.toml +3 -3
- {leanplot-1.0.0 → leanplot-1.1.1}/LICENSE.txt +0 -0
- {leanplot-1.0.0 → leanplot-1.1.1}/README.md +0 -0
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot/__init__.py +0 -0
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot/core/__init__.py +0 -0
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot/tests/__init__.py +0 -0
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot/tests/test_line.py +0 -0
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot.egg-info/dependency_links.txt +0 -0
- {leanplot-1.0.0 → leanplot-1.1.1}/leanplot.egg-info/top_level.txt +0 -0
- {leanplot-1.0.0 → leanplot-1.1.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: leanplot
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: Provides some classes for fast matplotlib plotting based on ISO 80000.
|
|
5
5
|
Author-email: Joel Kimmich <software@igte.uni-stuttgart.de>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -8,7 +8,7 @@ Project-URL: Homepage, https://codeberg.org/IGTE/leanplot
|
|
|
8
8
|
Project-URL: Documentation, https://codeberg.org/IGTE/leanplot
|
|
9
9
|
Project-URL: Repository, https://codeberg.org/IGTE/leanplot
|
|
10
10
|
Project-URL: Issues, https://codeberg.org/IGTE/leanplot/issues
|
|
11
|
-
Project-URL: Changelog, https://codeberg.org/IGTE/leanplot/CHANGELOG.rst
|
|
11
|
+
Project-URL: Changelog, https://codeberg.org/IGTE/leanplot/src/branch/main/CHANGELOG.rst
|
|
12
12
|
Classifier: Development Status :: 4 - Beta
|
|
13
13
|
Classifier: Intended Audience :: Science/Research
|
|
14
14
|
Classifier: Intended Audience :: Education
|
|
@@ -31,7 +31,7 @@ Description-Content-Type: text/markdown
|
|
|
31
31
|
License-File: LICENSE.txt
|
|
32
32
|
Requires-Dist: matplotlib>=3.10.0
|
|
33
33
|
Requires-Dist: numpy>=2.0.0
|
|
34
|
-
Requires-Dist: cmcrameri
|
|
34
|
+
Requires-Dist: cmcrameri>=1.9
|
|
35
35
|
Provides-Extra: dev
|
|
36
36
|
Requires-Dist: ruff>=0.15.8; extra == "dev"
|
|
37
37
|
Requires-Dist: build>=1.4.2; extra == "dev"
|
|
@@ -29,8 +29,8 @@ class BarPlot(PlotMixin):
|
|
|
29
29
|
return min_diff * 0.8
|
|
30
30
|
return 1
|
|
31
31
|
|
|
32
|
-
def plot(self):
|
|
33
|
-
self.ax.bar(self.x, self.ys, width=self.bar_width, color=next(self.next_color))
|
|
32
|
+
def plot(self, **kwargs):
|
|
33
|
+
self.ax.bar(self.x, self.ys, width=self.bar_width, color=next(self.next_color), **kwargs)
|
|
34
34
|
self.format()
|
|
35
35
|
|
|
36
36
|
def format(self):
|
leanplot-1.0.0/leanplot/core/colors/categorical.py → leanplot-1.1.1/leanplot/core/colors/palette.py
RENAMED
|
@@ -22,14 +22,35 @@ class ColorPalette:
|
|
|
22
22
|
Number of categorical colors to use from the colormap.
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
|
-
def __init__(self,
|
|
26
|
-
|
|
25
|
+
def __init__(self,
|
|
26
|
+
colormap_name: str = "batlow",
|
|
27
|
+
number_of_colors: int = 5,
|
|
28
|
+
categorial: bool = True,
|
|
29
|
+
reversed_colormap: bool = False) -> None:
|
|
30
|
+
if colormap_name.endswith("_r"):
|
|
31
|
+
colormap_name = colormap_name[:-2]
|
|
32
|
+
reversed_colormap = True
|
|
33
|
+
if colormap_name.endswith("S"):
|
|
34
|
+
colormap_name = colormap_name[:-1]
|
|
35
|
+
categorial = True
|
|
36
|
+
self.__colormap_name = colormap_name
|
|
27
37
|
self.number_of_colors = number_of_colors
|
|
38
|
+
self.categorial = categorial
|
|
39
|
+
self.reversed_colormap = reversed_colormap
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def colormap_name(self) -> str:
|
|
43
|
+
append_str = ""
|
|
44
|
+
if self.categorial:
|
|
45
|
+
append_str += "S"
|
|
46
|
+
if self.reversed_colormap:
|
|
47
|
+
append_str += "_r"
|
|
48
|
+
return self.__colormap_name + append_str
|
|
28
49
|
|
|
29
50
|
@property
|
|
30
51
|
def colors(self) -> list[tuple[float, float, float]]:
|
|
31
52
|
"""
|
|
32
|
-
Return
|
|
53
|
+
Return colors from the predefined colormap.
|
|
33
54
|
|
|
34
55
|
Returns
|
|
35
56
|
-------
|
|
@@ -39,18 +60,23 @@ class ColorPalette:
|
|
|
39
60
|
Raises
|
|
40
61
|
------
|
|
41
62
|
AttributeError
|
|
42
|
-
If the
|
|
63
|
+
If the colormap `colormap_name` is not defined in `cmcrameri.cm`.
|
|
43
64
|
ValueError
|
|
44
65
|
If `number_of_colors` exceeds the number of colors available in the categorical colormap.
|
|
45
66
|
"""
|
|
46
|
-
|
|
47
|
-
|
|
67
|
+
colormap = getattr(cmc, self.colormap_name)
|
|
68
|
+
if self.categorial:
|
|
69
|
+
available_colors = colormap.colors
|
|
70
|
+
else:
|
|
71
|
+
available_colors = colormap.resampled(self.number_of_colors).colors
|
|
48
72
|
if self.number_of_colors > len(available_colors):
|
|
49
73
|
raise ValueError(
|
|
50
74
|
f"Requested {self.number_of_colors} colors, but colormap "
|
|
51
|
-
f"'{self.colormap_name}
|
|
75
|
+
f"'{self.colormap_name}' only provides {len(available_colors)} colors."
|
|
52
76
|
)
|
|
53
|
-
|
|
77
|
+
if self.categorial:
|
|
78
|
+
return [tuple(color[:3]) for color in available_colors[: self.number_of_colors]]
|
|
79
|
+
return [tuple(color[:3]) for color in available_colors]
|
|
54
80
|
|
|
55
81
|
@staticmethod
|
|
56
82
|
def available_categorical_colormap_names() -> list[str]:
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
# ------------------------------------------------------------------------------
|
|
2
|
-
# Copyright (c) 2026 Joel Kimmich
|
|
3
|
-
# ------------------------------------------------------------------------------
|
|
4
|
-
# License
|
|
5
|
-
# This file is part of LeanPlot, distributed under MIT license.
|
|
6
|
-
# ------------------------------------------------------------------------------
|
|
7
|
-
#
|
|
8
|
-
|
|
9
1
|
# ------------------------------------------------------------------------------
|
|
10
2
|
# Copyright (c) 2026 Joel Kimmich
|
|
11
3
|
# ------------------------------------------------------------------------------
|
|
@@ -93,7 +85,7 @@ class DoubleY(PlotMixin):
|
|
|
93
85
|
self.ax_right.set_ylim(right_min, right_max)
|
|
94
86
|
self.ax_right.set_yticks(right_ticks)
|
|
95
87
|
|
|
96
|
-
def plot(self):
|
|
88
|
+
def plot(self, **kwargs):
|
|
97
89
|
|
|
98
90
|
for i, y in enumerate(self.ys_left):
|
|
99
91
|
self._add_line_and_label(
|
|
@@ -105,6 +97,7 @@ class DoubleY(PlotMixin):
|
|
|
105
97
|
marker=next(self.next_marker),
|
|
106
98
|
markersize=self.marker_size,
|
|
107
99
|
linestyle="None",
|
|
100
|
+
**kwargs
|
|
108
101
|
),
|
|
109
102
|
self.labels_left[i],
|
|
110
103
|
)
|
|
@@ -119,6 +112,7 @@ class DoubleY(PlotMixin):
|
|
|
119
112
|
marker=next(self.next_marker),
|
|
120
113
|
markersize=self.marker_size,
|
|
121
114
|
linestyle="None",
|
|
115
|
+
**kwargs
|
|
122
116
|
),
|
|
123
117
|
self.labels_right[i],
|
|
124
118
|
)
|
|
@@ -168,7 +162,7 @@ class DoubleYSeparated(DoubleY):
|
|
|
168
162
|
self.labels = labels
|
|
169
163
|
self.same_marker = same_marker
|
|
170
164
|
|
|
171
|
-
def plot(self):
|
|
165
|
+
def plot(self, **kwargs):
|
|
172
166
|
|
|
173
167
|
for i, (y_left, y_right) in enumerate(zip(self.ys_left, self.ys_right)):
|
|
174
168
|
marker = next(self.next_marker)
|
|
@@ -181,6 +175,7 @@ class DoubleYSeparated(DoubleY):
|
|
|
181
175
|
marker=marker,
|
|
182
176
|
markersize=self.marker_size,
|
|
183
177
|
linestyle="None",
|
|
178
|
+
**kwargs,
|
|
184
179
|
)
|
|
185
180
|
)
|
|
186
181
|
|
|
@@ -195,6 +190,7 @@ class DoubleYSeparated(DoubleY):
|
|
|
195
190
|
marker=marker,
|
|
196
191
|
markersize=self.marker_size,
|
|
197
192
|
linestyle="None",
|
|
193
|
+
**kwargs,
|
|
198
194
|
)
|
|
199
195
|
)
|
|
200
196
|
|
|
@@ -58,7 +58,10 @@ def custom_numeric_ticks_formatter(x, pos):
|
|
|
58
58
|
return f"{x:g}".replace(".", ",")
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
def format_date_x_axis(start_date: datetime,
|
|
61
|
+
def format_date_x_axis(start_date: datetime,
|
|
62
|
+
end_date: datetime,
|
|
63
|
+
ax,
|
|
64
|
+
return_version: bool = True) -> str | None:
|
|
62
65
|
"""
|
|
63
66
|
Formats the ticks of an axis as date.
|
|
64
67
|
|
|
@@ -22,6 +22,7 @@ class LinePlot(PlotMixin):
|
|
|
22
22
|
x_title=None,
|
|
23
23
|
width_mm=160,
|
|
24
24
|
height_mm=90,
|
|
25
|
+
**kwargs,
|
|
25
26
|
):
|
|
26
27
|
if not isinstance(ys, list):
|
|
27
28
|
if not (isinstance(ys, np.ndarray) and len(ys.shape) > 1 and ys.shape[0] > 1 and ys.shape[1] > 1):
|
|
@@ -30,7 +31,9 @@ class LinePlot(PlotMixin):
|
|
|
30
31
|
if len(ys) == len(x):
|
|
31
32
|
ys = [np.array(ys)]
|
|
32
33
|
ys = [np.array(y) for y in ys]
|
|
33
|
-
super().__init__(
|
|
34
|
+
super().__init__(
|
|
35
|
+
x=np.array(x), ys=ys, y_title=y_title, x_title=x_title, width_mm=width_mm, height_mm=height_mm, **kwargs
|
|
36
|
+
)
|
|
34
37
|
|
|
35
38
|
if labels is None:
|
|
36
39
|
labels = [None] * len(ys)
|
|
@@ -41,7 +44,7 @@ class LinePlot(PlotMixin):
|
|
|
41
44
|
self.y_scale = y_scale
|
|
42
45
|
self.line_width = linewidth
|
|
43
46
|
|
|
44
|
-
def plot(self, x=None, ys=None, labels=None):
|
|
47
|
+
def plot(self, x=None, ys=None, labels=None, **kwargs):
|
|
45
48
|
if x is None:
|
|
46
49
|
x = self.x
|
|
47
50
|
if ys is None:
|
|
@@ -59,6 +62,7 @@ class LinePlot(PlotMixin):
|
|
|
59
62
|
color=next(self.next_color),
|
|
60
63
|
linewidth=self.line_width,
|
|
61
64
|
linestyle=next(self.next_line_style),
|
|
65
|
+
**kwargs
|
|
62
66
|
)
|
|
63
67
|
)
|
|
64
68
|
self.format()
|
|
@@ -10,7 +10,7 @@ from datetime import datetime
|
|
|
10
10
|
import matplotlib.ticker as ticker
|
|
11
11
|
from matplotlib import pyplot as plt
|
|
12
12
|
|
|
13
|
-
from leanplot.core.colors.
|
|
13
|
+
from leanplot.core.colors.palette import ColorPalette
|
|
14
14
|
from leanplot.core.functions import cm_to_inch, custom_numeric_ticks_formatter, format_date_x_axis
|
|
15
15
|
|
|
16
16
|
|
|
@@ -25,7 +25,7 @@ class PlotMixin(object):
|
|
|
25
25
|
width_mm=160,
|
|
26
26
|
height_mm=90,
|
|
27
27
|
iter_color_and_style_together: bool = False,
|
|
28
|
-
iter_color_first: bool =
|
|
28
|
+
iter_color_first: bool = False,
|
|
29
29
|
color_palette: ColorPalette | str | None = None,
|
|
30
30
|
):
|
|
31
31
|
self.fig, self.ax = plt.subplots(layout="constrained")
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# ------------------------------------------------------------------------------
|
|
2
|
+
# Copyright (c) 2026 Joel Kimmich
|
|
3
|
+
# ------------------------------------------------------------------------------
|
|
4
|
+
# License
|
|
5
|
+
# This file is part of LeanPlot, distributed under MIT license.
|
|
6
|
+
# ------------------------------------------------------------------------------
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
import matplotlib.pyplot as plt
|
|
10
|
+
import numpy as np
|
|
11
|
+
|
|
12
|
+
# make data:
|
|
13
|
+
np.random.seed(1)
|
|
14
|
+
x = [2.1, 3.8, 5.6]
|
|
15
|
+
y = [2.6, 5, 4.2]
|
|
16
|
+
yerr = [0.9, 1.2, 0.5]
|
|
17
|
+
xerr = [0.2, 0.8, 0.3]
|
|
18
|
+
|
|
19
|
+
# plot:
|
|
20
|
+
fig, ax = plt.subplots()
|
|
21
|
+
|
|
22
|
+
ax.errorbar(x, y, yerr, xerr=xerr, fmt='o', linewidth=2, capsize=6)
|
|
23
|
+
|
|
24
|
+
ax.set(xlim=(0, 8), xticks=np.arange(1, 8),
|
|
25
|
+
ylim=(0, 8), yticks=np.arange(1, 8))
|
|
26
|
+
ax.grid(True)
|
|
27
|
+
plt.tight_layout()
|
|
28
|
+
plt.show()
|
|
@@ -10,7 +10,7 @@ from datetime import datetime
|
|
|
10
10
|
from unittest import TestCase
|
|
11
11
|
from unittest.mock import MagicMock, patch
|
|
12
12
|
|
|
13
|
-
from leanplot.core.colors.
|
|
13
|
+
from leanplot.core.colors.palette import ColorPalette
|
|
14
14
|
from leanplot.core.mixin import PlotMixin
|
|
15
15
|
|
|
16
16
|
|
|
@@ -74,6 +74,7 @@ class TestPlotMixin(TestCase):
|
|
|
74
74
|
|
|
75
75
|
def test_color_iter_cycles_back_to_first_color(self):
|
|
76
76
|
"""Verify that color_iter wraps around to the first color after exhausting the palette."""
|
|
77
|
+
self.plot_mixin.iter_color_first = True
|
|
77
78
|
colors = self.plot_mixin.colors
|
|
78
79
|
color_generator = self.plot_mixin.color_iter()
|
|
79
80
|
produced_colors = [next(color_generator) for _ in range(len(colors) + 1)]
|
|
@@ -88,6 +89,7 @@ class TestPlotMixin(TestCase):
|
|
|
88
89
|
|
|
89
90
|
def test_line_style_iter_switches_style_after_one_full_color_cycle(self):
|
|
90
91
|
"""Verify that line_style_iter switches to the next style after cycling through all colors."""
|
|
92
|
+
self.plot_mixin.iter_color_first = True
|
|
91
93
|
number_of_colors = len(self.plot_mixin.colors)
|
|
92
94
|
line_style_generator = self.plot_mixin.line_style_iter()
|
|
93
95
|
produced_styles = [next(line_style_generator) for _ in range(number_of_colors + 1)]
|
leanplot-1.0.0/leanplot/tests/test_categorical.py → leanplot-1.1.1/leanplot/tests/test_palette.py
RENAMED
|
@@ -9,30 +9,55 @@ from unittest import TestCase
|
|
|
9
9
|
|
|
10
10
|
import cmcrameri.cm as cmc
|
|
11
11
|
|
|
12
|
-
from leanplot.core.colors.
|
|
12
|
+
from leanplot.core.colors.palette import ColorPalette
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class TestColorPalette(TestCase):
|
|
16
16
|
def test_default_initialization_uses_batlow_with_ten_colors(self):
|
|
17
17
|
"""Verify that default parameters select the batlow colormap with ten colors."""
|
|
18
|
-
color_palette = ColorPalette()
|
|
19
|
-
self.assertEqual(color_palette.colormap_name, "
|
|
18
|
+
color_palette = ColorPalette(categorial=False)
|
|
19
|
+
self.assertEqual(color_palette.colormap_name, "batlow")
|
|
20
20
|
self.assertEqual(color_palette.number_of_colors, 5)
|
|
21
21
|
|
|
22
|
+
def test_reverse_colormap(self):
|
|
23
|
+
"""Verify that the reverse colormap works correctly."""
|
|
24
|
+
color_palette = ColorPalette(categorial=False, reversed_colormap=True)
|
|
25
|
+
self.assertEqual(color_palette.colormap_name, "batlow_r")
|
|
26
|
+
|
|
27
|
+
def test_categorial_colormap(self):
|
|
28
|
+
"""Verify that the reverse colormap works correctly."""
|
|
29
|
+
color_palette = ColorPalette(categorial=True, reversed_colormap=False)
|
|
30
|
+
self.assertEqual(color_palette.colormap_name, "batlowS")
|
|
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
|
+
|
|
22
47
|
def test_colors_returns_requested_number_of_colors(self):
|
|
23
48
|
"""Verify that the colors property returns exactly number_of_colors entries."""
|
|
24
|
-
color_palette = ColorPalette(colormap_name="
|
|
49
|
+
color_palette = ColorPalette(colormap_name="oslo", number_of_colors=6)
|
|
25
50
|
self.assertEqual(len(color_palette.colors), 6)
|
|
26
51
|
|
|
27
52
|
def test_colors_returns_rgb_tuples_with_three_components(self):
|
|
28
53
|
"""Verify that each returned color is a tuple of three components."""
|
|
29
|
-
color_palette = ColorPalette(colormap_name="
|
|
54
|
+
color_palette = ColorPalette(colormap_name="oslo", number_of_colors=4)
|
|
30
55
|
for color in color_palette.colors:
|
|
31
56
|
self.assertEqual(len(color), 3)
|
|
32
57
|
|
|
33
58
|
def test_colors_components_are_within_valid_range(self):
|
|
34
59
|
"""Verify that each color component lies within the closed interval [0, 1]."""
|
|
35
|
-
color_palette = ColorPalette(colormap_name="
|
|
60
|
+
color_palette = ColorPalette(colormap_name="oslo", number_of_colors=10)
|
|
36
61
|
for color in color_palette.colors:
|
|
37
62
|
for component in color:
|
|
38
63
|
self.assertGreaterEqual(component, 0.0)
|
|
@@ -40,8 +65,8 @@ class TestColorPalette(TestCase):
|
|
|
40
65
|
|
|
41
66
|
def test_colors_match_source_categorical_colormap(self):
|
|
42
67
|
"""Verify that returned colors match the first entries of the underlying categorical colormap."""
|
|
43
|
-
color_palette = ColorPalette(colormap_name="
|
|
44
|
-
expected_colors = [tuple(color[:3]) for color in cmc.
|
|
68
|
+
color_palette = ColorPalette(colormap_name="batlow", number_of_colors=3, categorial=True)
|
|
69
|
+
expected_colors = [tuple(color[:3]) for color in cmc.batlowS.colors[:3]]
|
|
45
70
|
self.assertEqual(color_palette.colors, expected_colors)
|
|
46
71
|
|
|
47
72
|
def test_invalid_colormap_name_raises_attribute_error(self):
|
|
@@ -52,13 +77,13 @@ class TestColorPalette(TestCase):
|
|
|
52
77
|
|
|
53
78
|
def test_number_of_colors_exceeding_available_raises_value_error(self):
|
|
54
79
|
"""Verify that requesting more colors than available raises a ValueError."""
|
|
55
|
-
available_color_count = len(cmc.
|
|
56
|
-
color_palette = ColorPalette(colormap_name="
|
|
80
|
+
available_color_count = len(cmc.osloS.colors)
|
|
81
|
+
color_palette = ColorPalette(colormap_name="oslo", number_of_colors=available_color_count + 1)
|
|
57
82
|
with self.assertRaises(ValueError):
|
|
58
83
|
_ = color_palette.colors
|
|
59
84
|
|
|
60
85
|
def test_number_of_colors_equal_to_available_does_not_raise(self):
|
|
61
86
|
"""Verify that requesting exactly the available number of colors succeeds without error."""
|
|
62
|
-
available_color_count = len(cmc.
|
|
63
|
-
color_palette = ColorPalette(colormap_name="
|
|
87
|
+
available_color_count = len(cmc.osloS.colors)
|
|
88
|
+
color_palette = ColorPalette(colormap_name="oslo", number_of_colors=available_color_count)
|
|
64
89
|
self.assertEqual(len(color_palette.colors), available_color_count)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: leanplot
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: Provides some classes for fast matplotlib plotting based on ISO 80000.
|
|
5
5
|
Author-email: Joel Kimmich <software@igte.uni-stuttgart.de>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -8,7 +8,7 @@ Project-URL: Homepage, https://codeberg.org/IGTE/leanplot
|
|
|
8
8
|
Project-URL: Documentation, https://codeberg.org/IGTE/leanplot
|
|
9
9
|
Project-URL: Repository, https://codeberg.org/IGTE/leanplot
|
|
10
10
|
Project-URL: Issues, https://codeberg.org/IGTE/leanplot/issues
|
|
11
|
-
Project-URL: Changelog, https://codeberg.org/IGTE/leanplot/CHANGELOG.rst
|
|
11
|
+
Project-URL: Changelog, https://codeberg.org/IGTE/leanplot/src/branch/main/CHANGELOG.rst
|
|
12
12
|
Classifier: Development Status :: 4 - Beta
|
|
13
13
|
Classifier: Intended Audience :: Science/Research
|
|
14
14
|
Classifier: Intended Audience :: Education
|
|
@@ -31,7 +31,7 @@ Description-Content-Type: text/markdown
|
|
|
31
31
|
License-File: LICENSE.txt
|
|
32
32
|
Requires-Dist: matplotlib>=3.10.0
|
|
33
33
|
Requires-Dist: numpy>=2.0.0
|
|
34
|
-
Requires-Dist: cmcrameri
|
|
34
|
+
Requires-Dist: cmcrameri>=1.9
|
|
35
35
|
Provides-Extra: dev
|
|
36
36
|
Requires-Dist: ruff>=0.15.8; extra == "dev"
|
|
37
37
|
Requires-Dist: build>=1.4.2; extra == "dev"
|
|
@@ -2,6 +2,7 @@ LICENSE.txt
|
|
|
2
2
|
README.md
|
|
3
3
|
pyproject.toml
|
|
4
4
|
leanplot/__init__.py
|
|
5
|
+
leanplot/debug.py
|
|
5
6
|
leanplot.egg-info/PKG-INFO
|
|
6
7
|
leanplot.egg-info/SOURCES.txt
|
|
7
8
|
leanplot.egg-info/dependency_links.txt
|
|
@@ -14,8 +15,8 @@ leanplot/core/functions.py
|
|
|
14
15
|
leanplot/core/line.py
|
|
15
16
|
leanplot/core/mixin.py
|
|
16
17
|
leanplot/core/colors/__init__.py
|
|
17
|
-
leanplot/core/colors/
|
|
18
|
+
leanplot/core/colors/palette.py
|
|
18
19
|
leanplot/tests/__init__.py
|
|
19
|
-
leanplot/tests/test_categorical.py
|
|
20
20
|
leanplot/tests/test_line.py
|
|
21
|
-
leanplot/tests/test_mixin.py
|
|
21
|
+
leanplot/tests/test_mixin.py
|
|
22
|
+
leanplot/tests/test_palette.py
|
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
name = "leanplot"
|
|
7
7
|
license = "MIT"
|
|
8
8
|
readme = "README.md"
|
|
9
|
-
version = "1.
|
|
9
|
+
version = "1.1.1"
|
|
10
10
|
authors = [
|
|
11
11
|
{ name = "Joel Kimmich", email = "software@igte.uni-stuttgart.de" }
|
|
12
12
|
]
|
|
@@ -15,7 +15,7 @@ requires-python = ">=3.11"
|
|
|
15
15
|
dependencies = [
|
|
16
16
|
"matplotlib>=3.10.0",
|
|
17
17
|
"numpy>=2.0.0",
|
|
18
|
-
"cmcrameri"
|
|
18
|
+
"cmcrameri>=1.9"
|
|
19
19
|
]
|
|
20
20
|
classifiers = [
|
|
21
21
|
"Development Status :: 4 - Beta",
|
|
@@ -42,7 +42,7 @@ Homepage = "https://codeberg.org/IGTE/leanplot"
|
|
|
42
42
|
Documentation = "https://codeberg.org/IGTE/leanplot"
|
|
43
43
|
Repository = "https://codeberg.org/IGTE/leanplot"
|
|
44
44
|
Issues = "https://codeberg.org/IGTE/leanplot/issues"
|
|
45
|
-
Changelog = "https://codeberg.org/IGTE/leanplot/CHANGELOG.rst"
|
|
45
|
+
Changelog = "https://codeberg.org/IGTE/leanplot/src/branch/main/CHANGELOG.rst"
|
|
46
46
|
|
|
47
47
|
[project.optional-dependencies]
|
|
48
48
|
#docs = ["Sphinx~=8.2.3", "sphinx_design~=0.6.1", "roman-numerals-py", "sphinx-gallery", "pydata_sphinx_theme>=0.16.1"]
|
|
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
|