Skip to content

Commit e213e62

Browse files
danielbentesclaude
andcommitted
fix: resolve ruff linting errors for CI
- Fix RUF059: prefix unused unpacked variables with underscore - _stat in evolution_runner.py (Mann-Whitney U test) - _fig in matplotlib_charts.py (plt.subplots returns) - Fix UP038: use union syntax for isinstance (str | int | float | bool) - Remove deprecated UP038 from ruff ignore list All 210 tests passing, ruff checks clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 78f6394 commit e213e62

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ ignore = [
145145
"SIM108", # ternary operators (if-else often clearer)
146146
"A002", # builtin shadowing (sometimes unavoidable)
147147
"B007", # unused loop variable (minor)
148-
"UP038", # isinstance style (minor)
149148
"C401", # generator comprehension style (minor)
150149
"RUF015", # iterator style (minor)
151150
"SIM118", # dict.keys() (explicit is fine)

siare/benchmarks/corpus/index_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def create_index(
151151
for doc in batch:
152152
doc_meta = {k: v for k, v in doc.items() if k not in ["doc_id", "text"]}
153153
# Ensure all values are serializable
154-
doc_meta = {k: str(v) if not isinstance(v, (str, int, float, bool)) else v
154+
doc_meta = {k: str(v) if not isinstance(v, str | int | float | bool) else v
155155
for k, v in doc_meta.items()}
156156
# ChromaDB requires non-empty metadata or None
157157
if not doc_meta:

siare/benchmarks/evolution_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ def _calculate_p_value(
657657
return None
658658

659659
# Mann-Whitney U test (non-parametric)
660-
stat, p_value = stats.mannwhitneyu(
660+
_stat, p_value = stats.mannwhitneyu(
661661
baseline, evolved, alternative="two-sided"
662662
)
663663
return float(p_value)

siare/benchmarks/visualization/matplotlib_charts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def radar_chart_static(
2828
angles = [n / float(N) * 2 * np.pi for n in range(N)]
2929
angles += angles[:1] # Complete the circle
3030

31-
fig, ax = plt.subplots(figsize=(8, 8), subplot_kw={"polar": True})
31+
_fig, ax = plt.subplots(figsize=(8, 8), subplot_kw={"polar": True})
3232

3333
# SIARE metrics
3434
values = list(metrics.values())
@@ -84,7 +84,7 @@ def beir_comparison_bar_static(
8484
datasets = list(results.keys())
8585
scores = [results[d].get(metric, 0) for d in datasets]
8686

87-
fig, ax = plt.subplots(figsize=(12, 6))
87+
_fig, ax = plt.subplots(figsize=(12, 6))
8888

8989
bars = ax.bar(datasets, scores, color="#1f77b4", edgecolor="black")
9090

@@ -130,7 +130,7 @@ def evolution_progress_static(
130130
gen_numbers = list(range(len(generations)))
131131
scores = [g.get(metric, 0) for g in generations]
132132

133-
fig, ax = plt.subplots(figsize=(10, 6))
133+
_fig, ax = plt.subplots(figsize=(10, 6))
134134

135135
ax.plot(gen_numbers, scores, "o-", linewidth=2, markersize=8, color="#1f77b4")
136136

0 commit comments

Comments
 (0)