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,16 @@
|
||||
# Makes a variant of the detectors for the pruning: copies <src> to <dst> (without .git) and replaces, in <file> (relative), each <old> by <new> (pairs of arguments; each old must occur exactly once). Args: <src> <dst> <file> <old> <new> [<old> <new> ...]
|
||||
import shutil, sys
|
||||
from pathlib import Path
|
||||
src, dst, rel, pairs = Path(sys.argv[1]), Path(sys.argv[2]), sys.argv[3], sys.argv[4:]
|
||||
if dst.exists():
|
||||
shutil.rmtree(dst)
|
||||
shutil.copytree(src, dst, ignore=shutil.ignore_patterns(".git", "__pycache__"))
|
||||
f = dst / rel
|
||||
text = f.read_text()
|
||||
for old, new in zip(pairs[::2], pairs[1::2]):
|
||||
n = text.count(old)
|
||||
if n != 1:
|
||||
sys.exit(f"{dst.name}: {n} occurrences of {old!r}")
|
||||
text = text.replace(old, new)
|
||||
f.write_text(text)
|
||||
print(dst.name, "ok")
|
||||
Reference in new issue
Block a user