Skip to content

Commit f854da5

Browse files
dan-blanchardclaude
andcommitted
fix: add --threads validation and docstring updates in compare_detectors.py
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8029f87 commit f854da5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

scripts/compare_detectors.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ def _run_timing_subprocess( # noqa: PLR0913
445445
For ``"chardet"`` only -- ``"all"``, ``"modern_web"``, or ``"none"``.
446446
pure : bool
447447
Abort if mypyc .so/.pyd files are found (chardet only).
448+
threads : int
449+
Number of detection threads to pass to ``benchmark_time.py``.
448450
449451
Returns
450452
-------
@@ -699,6 +701,8 @@ def run_comparison( # noqa: PLR0913
699701
Hash of benchmark source files for cache invalidation.
700702
no_memory : bool
701703
Skip memory benchmarks when ``True``.
704+
threads : int
705+
Number of detection threads to pass to ``benchmark_time.py``.
702706
703707
"""
704708
if detector_versions is None:
@@ -1251,6 +1255,8 @@ def _run_timing_for_detector(
12511255

12521256
if args.pure and args.mypyc:
12531257
parser.error("--pure and --mypyc are mutually exclusive")
1258+
if args.threads < 1:
1259+
parser.error("--threads must be >= 1")
12541260

12551261
# Force line-buffered stdout so progress is visible when piped (e.g. tee).
12561262
sys.stdout.reconfigure(line_buffering=True)

0 commit comments

Comments
 (0)