Skip to content

Commit 136fe03

Browse files
authored
Merge pull request #38 from datum-cloud/fwidjaja-patch-3
v1.0.1
2 parents 2a8d9f9 + 3d7eea5 commit 136fe03

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

scripts/evaluate_candidates.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""
66

77
import os
8+
import sys
89
import json
910
import anthropic
1011
from typing import Dict, Any, List
@@ -246,13 +247,25 @@ def main():
246247
"""Main entry point"""
247248
import sys
248249
from datetime import datetime
250+
from pathlib import Path
249251

250-
# Check for input file
251-
if len(sys.argv) < 2:
252-
print("Usage: python evaluate_candidates.py <candidates_file.json>")
253-
return 1
254-
255-
input_file = sys.argv[1]
252+
# Auto-find latest scan file or use provided file
253+
if len(sys.argv) >= 2:
254+
input_file = sys.argv[1]
255+
else:
256+
# Auto-find latest scan file
257+
candidates_dir = Path('data/candidates')
258+
if not candidates_dir.exists():
259+
print("❌ No candidates directory found. Run monitor_news.py first.")
260+
return 1
261+
262+
scan_files = sorted(candidates_dir.glob('scan-*.json'))
263+
if not scan_files:
264+
print("❌ No scan files found. Run monitor_news.py first.")
265+
return 1
266+
267+
input_file = str(scan_files[-1])
268+
print(f"📂 Auto-selected latest scan: {input_file}")
256269

257270
# Load candidates
258271
try:

0 commit comments

Comments
 (0)