-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_setup.ps1
More file actions
27 lines (21 loc) · 804 Bytes
/
run_setup.ps1
File metadata and controls
27 lines (21 loc) · 804 Bytes
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
# --- run_setup.ps1 (safe version) ---
# Set PYTHONPATH to ./src, verify import, then run the runner.
$ErrorActionPreference = "Stop"
# 1) Set PYTHONPATH
$srcPath = (Resolve-Path ".\src").Path
$env:PYTHONPATH = $srcPath
Write-Host ""
Write-Host "PYTHONPATH set to: $srcPath"
# 2) Quick import check (baseline module must exist)
python -c "import importlib,sys,os; sys.path.insert(0, os.path.abspath('src')); importlib.import_module('bsml.policies.baseline'); print('import ok')"
if ($LASTEXITCODE -ne 0) {
Write-Host "Import failed. Check that src\bsml\policies\baseline.py exists." -ForegroundColor Red
exit 1
}
# 3) Run the runner
Write-Host ""
Write-Host "Running backtest..."
python -m bsml.core.runner
# 4) End
Write-Host ""
Write-Host ("Finished at {0}" -f (Get-Date -Format "HH:mm:ss"))