37 lines
1.3 KiB
Python
37 lines
1.3 KiB
Python
"""Run the frozen Tourism research check against local snapshots."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
import json
|
|
from pathlib import Path
|
|
|
|
from app.prices import PriceSnapshotStore
|
|
from app.research import ResearchRunStore, run_tourism_research
|
|
from app.vintages import VintageStore
|
|
|
|
|
|
def main() -> int:
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
parser.add_argument("--data-root", type=Path, default=Path(__file__).resolve().parents[1] / "data")
|
|
parser.add_argument("--min-events", type=int, default=12)
|
|
parser.add_argument("--windows", type=int, nargs="+", default=[1, 3, 5, 20])
|
|
parser.add_argument("--cost-bps", type=float, default=20.0)
|
|
parser.add_argument("--execution-lag-sessions", type=int, default=1)
|
|
args = parser.parse_args()
|
|
report = run_tourism_research(
|
|
VintageStore(args.data_root),
|
|
PriceSnapshotStore(args.data_root / "prices"),
|
|
ResearchRunStore(args.data_root / "research"),
|
|
min_events=args.min_events,
|
|
windows=args.windows,
|
|
cost_bps=args.cost_bps,
|
|
execution_lag_sessions=args.execution_lag_sessions,
|
|
)
|
|
print(json.dumps(report, ensure_ascii=False, indent=2, sort_keys=True))
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|