diff --git a/scripts/run_daily_reentry_matrix.py b/scripts/run_daily_reentry_matrix.py index f71f79e..7b2d6ce 100644 --- a/scripts/run_daily_reentry_matrix.py +++ b/scripts/run_daily_reentry_matrix.py @@ -31,7 +31,6 @@ if str(ROOT) not in sys.path: from scripts.research_rankings import ( # noqa: E402 _live_universe_rank_map, - _period_percentiles, ) POLICY_NAMES = ( diff --git a/scripts/run_execution_recovery_matrix.py b/scripts/run_execution_recovery_matrix.py index 07abdfa..6c3f615 100644 --- a/scripts/run_execution_recovery_matrix.py +++ b/scripts/run_execution_recovery_matrix.py @@ -57,7 +57,6 @@ if str(ROOT) not in sys.path: from scripts.research_rankings import ( # noqa: E402 _live_universe_rank_map, - _period_percentiles, ) # Must match Phase A cache when reusing research-cands.pkl diff --git a/scripts/run_fip_breadth_diagnostics.py b/scripts/run_fip_breadth_diagnostics.py index 3c55376..e5e17d3 100644 --- a/scripts/run_fip_breadth_diagnostics.py +++ b/scripts/run_fip_breadth_diagnostics.py @@ -162,13 +162,13 @@ def _load_job(conn, symbol: str, spy: dict) -> tuple | None: if len(rows) < 90: return None ords, opens, highs, lows, closes, vols = [], [], [], [], [], [] - for d, o, h, l, c, v in rows: + for d, o, h, lo, c, v in rows: if isinstance(d, str): d = date.fromisoformat(d[:10]) ords.append(d.toordinal()) opens.append(float(o)) highs.append(float(h)) - lows.append(float(l)) + lows.append(float(lo)) closes.append(float(c)) vols.append(float(v or 0)) return (symbol, ords, opens, highs, lows, closes, vols, spy) @@ -275,7 +275,8 @@ def main() -> None: vol_weeks = collected.get("vol_6m") or {} momr_weeks = collected.get("mom_12_1_resid") or {} - # Index mom/vol by (week, symbol) for joins + # Index mom by (week, symbol) for joins. vol/momr are consumed as week maps + # directly further down, so they need no index. def _index(weeks_map: dict) -> dict[tuple, dict]: out: dict[tuple, dict] = {} for wk, recs in weeks_map.items(): @@ -290,8 +291,6 @@ def main() -> None: return out mom_ix = _index(mom_weeks) - vol_ix = _index(vol_weeks) - momr_ix = _index(momr_weeks) # Per-week membership + extended checks via shared rich filter same_week: dict[tuple, list[tuple[float, float]]] = defaultdict(list) @@ -606,8 +605,8 @@ def _update_md(path: Path, results: dict, artifact: Path) -> None: "", "### Authoritative unconditional fip (liquid top-N, post-mask)", "", - f"| metric | value |", - f"|---|---|", + "| metric | value |", + "|---|---|", f"| mean_ic | {h.get('mean_ic')} |", f"| ic_t_stat | {h.get('ic_t_stat')} |", f"| weeks | {h.get('weeks')} |", diff --git a/scripts/run_fip_breadth_research.py b/scripts/run_fip_breadth_research.py index 9b0e57a..a20c7ff 100644 --- a/scripts/run_fip_breadth_research.py +++ b/scripts/run_fip_breadth_research.py @@ -162,8 +162,8 @@ def _write_md(path: Path, payload: dict) -> None: row = br.get("row") or br if row: lines.extend([ - f"| metric | value |", - f"|---|---|", + "| metric | value |", + "|---|---|", f"| mean_ic | {row.get('mean_ic')} |", f"| ic_t_stat | {row.get('ic_t_stat')} |", f"| ic_positive_pct | {row.get('ic_positive_pct')} |", diff --git a/scripts/run_prod_book_universe_matrix.py b/scripts/run_prod_book_universe_matrix.py index 6d5b9cc..cc53b2d 100644 --- a/scripts/run_prod_book_universe_matrix.py +++ b/scripts/run_prod_book_universe_matrix.py @@ -26,7 +26,6 @@ import os import pickle import sys import time -from collections import defaultdict from concurrent.futures import ProcessPoolExecutor from datetime import date, datetime from pathlib import Path diff --git a/scripts/run_research_matrix.py b/scripts/run_research_matrix.py index d771a4b..f16c121 100644 --- a/scripts/run_research_matrix.py +++ b/scripts/run_research_matrix.py @@ -70,7 +70,6 @@ if str(ROOT) not in sys.path: from scripts.research_rankings import ( # noqa: E402 _live_universe_rank_map, - _period_percentiles, ) CACHE_VERSION = "research-matrix-v1-daily-prod" diff --git a/tests/unit/test_openai_sentiment_provider.py b/tests/unit/test_openai_sentiment_provider.py index 262c75a..877fd5e 100644 --- a/tests/unit/test_openai_sentiment_provider.py +++ b/tests/unit/test_openai_sentiment_provider.py @@ -2,9 +2,8 @@ from __future__ import annotations -from datetime import datetime, timezone from types import SimpleNamespace -from unittest.mock import AsyncMock, MagicMock, patch +from unittest.mock import AsyncMock, patch import pytest diff --git a/tests/unit/test_research_snapshot_manifest.py b/tests/unit/test_research_snapshot_manifest.py index 6205167..4232998 100644 --- a/tests/unit/test_research_snapshot_manifest.py +++ b/tests/unit/test_research_snapshot_manifest.py @@ -2,7 +2,6 @@ from __future__ import annotations -import json import sys from pathlib import Path diff --git a/tests/unit/test_sec_client.py b/tests/unit/test_sec_client.py index 31a82d7..80704c9 100644 --- a/tests/unit/test_sec_client.py +++ b/tests/unit/test_sec_client.py @@ -3,7 +3,6 @@ httpx transport (no network).""" from __future__ import annotations -import json from datetime import date import httpx