Skip to content

Commit 00f266f

Browse files
Fix lint: use module-level logger in staticmethod, black formatting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e234df4 commit 00f266f

2 files changed

Lines changed: 39 additions & 10 deletions

File tree

src/metrics/base.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,11 @@ def adjust_difficulty_for_instructions(
210210
"\n[Difficulty Band Check — %s]\n"
211211
" Requested: %s (%s–%s)\n"
212212
" Raw score: %s — within band, no adjustment.",
213-
self.name, requested_difficulty, low, high, raw_score,
213+
self.name,
214+
requested_difficulty,
215+
low,
216+
high,
217+
raw_score,
214218
)
215219
return raw_score
216220

@@ -224,7 +228,14 @@ def adjust_difficulty_for_instructions(
224228
" Requested: %s (%s–%s)\n"
225229
" Raw score: %s — outside band by %.1f pts\n"
226230
" Penalty: -%s → %s",
227-
self.name, requested_difficulty, low, high, raw_score, distance, penalty, adjusted,
231+
self.name,
232+
requested_difficulty,
233+
low,
234+
high,
235+
raw_score,
236+
distance,
237+
penalty,
238+
adjusted,
228239
)
229240
return adjusted
230241

@@ -360,7 +371,12 @@ def adjust_score_for_custom_prompt(
360371
" Relevant: %s\n"
361372
" Adjustment: %+.2f (%.1f → %.1f)\n"
362373
" Reasoning: %s",
363-
self.name, relevant, adjustment, raw_score, final, reasoning,
374+
self.name,
375+
relevant,
376+
adjustment,
377+
raw_score,
378+
final,
379+
reasoning,
364380
)
365381

366382
return final

src/runners/benchmark.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from ..utils.config_loader import ConfigLoader
1818
from ..utils.io import IOUtils
1919

20+
logger = logging.getLogger(__name__)
2021

2122
class BenchmarkRunner:
2223

@@ -280,14 +281,19 @@ def _check_difficulty_compliance(
280281
in_band = low <= mean_difficulty <= high
281282

282283
if in_band:
283-
self.logger.debug(
284+
logger.debug(
284285
"\n[Difficulty Compliance — %s]"
285286
"\n Requested : %s (band %s–%s)"
286287
"\n Mean score: %s ✓ within band"
287288
"\n Questions : %s scored"
288289
"\n Adjusted : %s (no penalty)",
289-
quiz_id, instructions.difficulty, low, high,
290-
mean_difficulty, len(difficulty_scores), mean_difficulty,
290+
quiz_id,
291+
instructions.difficulty,
292+
low,
293+
high,
294+
mean_difficulty,
295+
len(difficulty_scores),
296+
mean_difficulty,
291297
)
292298
return mean_difficulty
293299

@@ -296,17 +302,24 @@ def _check_difficulty_compliance(
296302
penalty = round(min(distance * 0.5, 30.0), 1)
297303
adjusted = round(max(0.0, min(100.0, mean_difficulty - penalty)), 1)
298304

299-
self.logger.debug(
305+
logger.debug(
300306
"\n[Difficulty Compliance — %s]"
301307
"\n Requested : %s (band %s–%s)"
302308
"\n Mean score: %s ✗ outside band by %.1f pts"
303309
"\n Penalty : -%s → adjusted mean = %s"
304310
"\n Questions : %s scored"
305311
"\n Note : Quiz overall difficulty does not match the "
306312
"'%s' instruction.",
307-
quiz_id, instructions.difficulty, low, high,
308-
mean_difficulty, distance, penalty, adjusted,
309-
len(difficulty_scores), instructions.difficulty,
313+
quiz_id,
314+
instructions.difficulty,
315+
low,
316+
high,
317+
mean_difficulty,
318+
distance,
319+
penalty,
320+
adjusted,
321+
len(difficulty_scores),
322+
instructions.difficulty,
310323
)
311324
return adjusted
312325

0 commit comments

Comments
 (0)