sessions of 2026-11-18 (the optimization campaign; three runs without summary, interrupted and rerun)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8a81c53cd9
commit
0cfbd1b7bc
363 files changed
+30822
No files matched your search
@@ -0,0 +1,17 @@
|
||||
# Makes a copy of the detectors (scripts/, bench/) in <dest> with one exact substitution in one script (fails if the old text is not found exactly once).
|
||||
# Usage: python3 variant.py <detectors dir> <dest> <scripts/file.py> <old text> <new text>
|
||||
import shutil
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
src, dest, rel, old, new = Path(sys.argv[1]), Path(sys.argv[2]), sys.argv[3], sys.argv[4], sys.argv[5]
|
||||
if dest.exists():
|
||||
shutil.rmtree(dest)
|
||||
for d in ("scripts", "bench"):
|
||||
shutil.copytree(src / d, dest / d, ignore=shutil.ignore_patterns("__pycache__"))
|
||||
f = dest / rel
|
||||
text = f.read_text()
|
||||
if text.count(old) != 1:
|
||||
sys.exit(f"{rel}: old text found {text.count(old)} times")
|
||||
f.write_text(text.replace(old, new))
|
||||
print(f"{dest}: {rel} changed")
|
||||
Reference in new issue
Block a user