chore: drop unused imports and a dead constant (no behaviour change)

- backtest/diagnose_filters: unused BacktestConfig import
- pair_signals/__init__: unused PlatformConfig import
- scripts/shadow_scan: unused pandas import
- research burst_precursors / calendar_impact / duka_spread: unused sys / COST / struct
- test_all: MagicMock, StringIO, Colors and two function-local imports that
  nothing in the test bodies used
- telegram_bot: ViolentWatch is only a type hint -> imported under TYPE_CHECKING

compare_oanda_tiingo.py and oanda_td_divergence.py are left alone here because
the hygiene commit deletes them.

Suite: 464 passed, 0 failed (unchanged).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0156YhogLytzj9P2iH1skGbL
This commit is contained in:
Harwinder Sekhon
2026-09-06 16:46:15 -04:00
parent c44813fd55
commit 45bd90d1b3
8 changed files with 10 additions and 14 deletions
-1
View File
@@ -45,7 +45,6 @@ from gpu_backtest import ( # noqa: E402
BAR_SECONDS,
GPUTechnicalEngine,
PAIR_ALIASES,
BacktestConfig,
IndicatorCache,
fetch_history,
precompute_indicators,
+1 -1
View File
@@ -9,7 +9,7 @@ within/outside the scheduled-data hours, and an out-of-sample logistic model
python backtest/research/burst_precursors.py PARQUET BAR_MINUTES [--k 3] [--start ... --end ...]
"""
import argparse, sys
import argparse
import numpy as np, pandas as pd
+1 -1
View File
@@ -7,7 +7,7 @@ import argparse, sys
from pathlib import Path
import numpy as np, pandas as pd
sys.path.insert(0, str(Path(__file__).resolve().parent))
from open_trade_bursts import wilder_atr, simulate, r_of, stats, K, COST
from open_trade_bursts import wilder_atr, simulate, r_of, stats, K
CAL = Path(__file__).resolve().parent.parent / "cache" / "calendar.parquet"
-1
View File
@@ -10,7 +10,6 @@ bi5 format: LZMA 'alone' stream of 20-byte big-endian records
XAUUSD prices scaled x1000. URL months are 0-indexed.
"""
import lzma
import struct
import sys
from concurrent.futures import ThreadPoolExecutor
from datetime import date, timedelta
+1 -1
View File
@@ -10,7 +10,7 @@ then register it in this file.
from typing import Optional, List, Dict, Callable
from config import PlatformConfig, Timeframe
from config import Timeframe
from signal_aggregator import SignalAggregator, SignalReport
from providers import BaseDataProvider
-2
View File
@@ -36,8 +36,6 @@ import time
from datetime import datetime, timezone
from pathlib import Path
import pandas as pd
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
from config import PlatformConfig, Timeframe, XAUUSD
+5 -2
View File
@@ -50,7 +50,7 @@ import threading
import time
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime, timezone
from typing import Any, Dict, List, Optional, Set
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update
from telegram.constants import ParseMode
@@ -77,7 +77,10 @@ from market_outlook import maybe_run_outlook
from news_engine import FundamentalContext, NewsEngine
from pair_signals import PAIR_PRODUCERS
from signal_aggregator import SignalAggregator, SignalReport
from violent_watch import ViolentWatch, attach_watch, should_send_headsup
from violent_watch import attach_watch, should_send_headsup
if TYPE_CHECKING: # type hints only — ViolentWatch is never needed at runtime here
from violent_watch import ViolentWatch
_APP = get_app_config()
+2 -5
View File
@@ -12,8 +12,7 @@ import threading
import tempfile
import traceback
from datetime import datetime, timedelta, timezone
from unittest.mock import patch, MagicMock
from io import StringIO
from unittest.mock import patch
import numpy as np
import pandas as pd
@@ -1489,7 +1488,7 @@ print("\n═══ Module 6: main.py ═══")
from main import (
signal_color, quality_color, _compact_reason,
report_to_dict, build_config, Colors,
report_to_dict, build_config,
)
@@ -2777,7 +2776,6 @@ def _():
@test("CP: cp_patterns subset filter excludes disabled detectors")
def _():
from dataclasses import replace
df = make_cp_df(double_bottom_closes())
cfg = XauStrategyConfig(cp_patterns=["bull_flag"])
assert detect_chart_pattern(df, atr=5.0, cfg=cfg) is None
@@ -7757,7 +7755,6 @@ def _():
@test("signal_log: analyze_pair weekend early-return is logged")
def _():
import signal_log as slog
from signal_aggregator import _is_forex_weekend
fd, path = tempfile.mkstemp(suffix=".db")
os.close(fd)
os.remove(path)