-
Notifications
You must be signed in to change notification settings - Fork 264
Expand file tree
/
Copy pathrun_cache_validation.sh
More file actions
executable file
·39 lines (31 loc) · 1.61 KB
/
run_cache_validation.sh
File metadata and controls
executable file
·39 lines (31 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Run ThetaData cache validation scenarios (pandas only)
set -euo pipefail
CACHE_DIR="/Users/robertgrzesik/Library/Caches/lumibot/1.0/thetadata"
LOG_DIR="tests/performance/logs"
mkdir -p "$LOG_DIR"
log() {
echo "$(date '+%Y-%m-%d %H:%M:%S') $1"
}
log "===================================================================================="
log "THETADATA CACHE VALIDATION - PANDAS COLD/WARM"
log "Cache directory: $CACHE_DIR"
log "Logs: $LOG_DIR"
log "===================================================================================="
log "Clearing cache directory"
rm -rf "$CACHE_DIR"
mkdir -p "$CACHE_DIR"
log "Running pandas cold backtest (pytest tests/test_thetadata_pandas_verification.py)"
pytest tests/test_thetadata_pandas_verification.py::test_pandas_cold_warm -vv --maxfail=1 \
> "$LOG_DIR/pandas_cold_warm.log" 2>&1
log "✓ Cold and warm runs completed (see pandas_cold_warm.log)"
log "Extracting diagnostics"
COLD_NET=$(grep -o "network_requests=[0-9\-]*" "$LOG_DIR/pandas_cold_warm.log" | head -1 | cut -d'=' -f2 || echo "?")
WARM_NET=$(grep -o "network_requests=[0-9\-]*" "$LOG_DIR/pandas_cold_warm.log" | tail -1 | cut -d'=' -f2 || echo "?")
log "Cold run network requests: ${COLD_NET}"
log "Warm run network requests: ${WARM_NET}"
log "===================================================================================="
log "OPTIONAL: parity profiling"
log "Run manually if desired: python tests/backtest/profile_thetadata_vs_polygon.py"
log "This will emit cold/warm parity logs for ThetaData vs Polygon comparisons"
log "===================================================================================="