Skip to content

Commit 7351b32

Browse files
fix: Resolve ruff lint and formatting errors in palettes, tests, and examples
Replace en-dash with hyphen-minus in docstring (RUF002), remove unused imports, and apply ruff formatting.
1 parent ae8c5b0 commit 7351b32

4 files changed

Lines changed: 283 additions & 64 deletions

File tree

examples/palettes_demo.py

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,31 @@
6363
# 4. Full catalogue — all 25 custom-style palettes as swatches
6464
# ---------------------------------------------------------------------------
6565
ALL_NAMES = [
66-
"CUSTOM", "PASTEL", "WARM", "COOL", "EARTH",
67-
"OCEAN", "ROSE", "FOREST", "LAVENDER", "SUNSET", "COASTAL",
68-
"SPRING", "SUMMER", "AUTUMN", "WINTER",
69-
"DAWN", "DUSK",
70-
"CANDY", "SMOKE", "VINTAGE", "NORDIC", "MEADOW", "CORAL", "TROPICAL", "POWDER",
66+
"CUSTOM",
67+
"PASTEL",
68+
"WARM",
69+
"COOL",
70+
"EARTH",
71+
"OCEAN",
72+
"ROSE",
73+
"FOREST",
74+
"LAVENDER",
75+
"SUNSET",
76+
"COASTAL",
77+
"SPRING",
78+
"SUMMER",
79+
"AUTUMN",
80+
"WINTER",
81+
"DAWN",
82+
"DUSK",
83+
"CANDY",
84+
"SMOKE",
85+
"VINTAGE",
86+
"NORDIC",
87+
"MEADOW",
88+
"CORAL",
89+
"TROPICAL",
90+
"POWDER",
7191
]
7292

7393
fig, axes = plt.subplots(len(ALL_NAMES), 1, figsize=(12, 18))
@@ -108,7 +128,7 @@
108128
# ---------------------------------------------------------------------------
109129
x = np.linspace(0, 4, 80)
110130
fig, ax = plt.subplots(figsize=(8, 4))
111-
spring = getattr(palettes, "SPRING")
131+
spring = palettes.SPRING
112132
base = np.zeros_like(x)
113133
for i in range(6):
114134
y = np.abs(np.sin(x + i * 0.5)) * (1 + 0.3 * i)
@@ -123,7 +143,7 @@
123143
# 7. Pie chart with CANDY palette
124144
# ---------------------------------------------------------------------------
125145
fig, ax = plt.subplots(figsize=(5, 5))
126-
candy = getattr(palettes, "CANDY")
146+
candy = palettes.CANDY
127147
sizes = [22, 18, 15, 13, 10, 8, 7, 4, 2, 1]
128148
ax.pie(sizes, colors=candy[:10], startangle=90, wedgeprops={"edgecolor": "white", "linewidth": 1.5})
129149
ax.set_title("CANDY palette — pie chart")
@@ -134,7 +154,7 @@
134154
# 8. Horizontal bar chart with DUSK palette
135155
# ---------------------------------------------------------------------------
136156
fig, ax = plt.subplots(figsize=(7, 5))
137-
dusk = getattr(palettes, "DUSK")
157+
dusk = palettes.DUSK
138158
categories = [f"Item {chr(65 + i)}" for i in range(11)]
139159
values = [45, 38, 35, 30, 28, 24, 20, 18, 14, 10, 6]
140160
ax.barh(categories, values, color=dusk)

examples/styles_demo.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,14 @@
104104
xc = rng.normal(2 + i * 1.5, 0.4, 12)
105105
yc = rng.normal(10 + i * 5, 2, 12)
106106
ax.errorbar(
107-
xc.mean(), yc.mean(),
108-
xerr=xc.std(), yerr=yc.std(),
109-
fmt="o", color=coral[i * 2], markersize=8, capsize=4,
107+
xc.mean(),
108+
yc.mean(),
109+
xerr=xc.std(),
110+
yerr=yc.std(),
111+
fmt="o",
112+
color=coral[i * 2],
113+
markersize=8,
114+
capsize=4,
110115
label=f"Group {i + 1}",
111116
)
112117
auto_ticks(ax)

0 commit comments

Comments
 (0)