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:
@@ -45,7 +45,6 @@ from gpu_backtest import ( # noqa: E402
|
|||||||
BAR_SECONDS,
|
BAR_SECONDS,
|
||||||
GPUTechnicalEngine,
|
GPUTechnicalEngine,
|
||||||
PAIR_ALIASES,
|
PAIR_ALIASES,
|
||||||
BacktestConfig,
|
|
||||||
IndicatorCache,
|
IndicatorCache,
|
||||||
fetch_history,
|
fetch_history,
|
||||||
precompute_indicators,
|
precompute_indicators,
|
||||||
|
|||||||
@@ -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 ...]
|
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
|
import numpy as np, pandas as pd
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import argparse, sys
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import numpy as np, pandas as pd
|
import numpy as np, pandas as pd
|
||||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
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"
|
CAL = Path(__file__).resolve().parent.parent / "cache" / "calendar.parquet"
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ bi5 format: LZMA 'alone' stream of 20-byte big-endian records
|
|||||||
XAUUSD prices scaled x1000. URL months are 0-indexed.
|
XAUUSD prices scaled x1000. URL months are 0-indexed.
|
||||||
"""
|
"""
|
||||||
import lzma
|
import lzma
|
||||||
import struct
|
|
||||||
import sys
|
import sys
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
from datetime import date, timedelta
|
from datetime import date, timedelta
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ then register it in this file.
|
|||||||
|
|
||||||
from typing import Optional, List, Dict, Callable
|
from typing import Optional, List, Dict, Callable
|
||||||
|
|
||||||
from config import PlatformConfig, Timeframe
|
from config import Timeframe
|
||||||
from signal_aggregator import SignalAggregator, SignalReport
|
from signal_aggregator import SignalAggregator, SignalReport
|
||||||
from providers import BaseDataProvider
|
from providers import BaseDataProvider
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ import time
|
|||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import pandas as pd
|
|
||||||
|
|
||||||
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
||||||
|
|
||||||
from config import PlatformConfig, Timeframe, XAUUSD
|
from config import PlatformConfig, Timeframe, XAUUSD
|
||||||
|
|||||||
+5
-2
@@ -50,7 +50,7 @@ import threading
|
|||||||
import time
|
import time
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
from datetime import datetime, timezone
|
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 import InlineKeyboardButton, InlineKeyboardMarkup, Update
|
||||||
from telegram.constants import ParseMode
|
from telegram.constants import ParseMode
|
||||||
@@ -77,7 +77,10 @@ from market_outlook import maybe_run_outlook
|
|||||||
from news_engine import FundamentalContext, NewsEngine
|
from news_engine import FundamentalContext, NewsEngine
|
||||||
from pair_signals import PAIR_PRODUCERS
|
from pair_signals import PAIR_PRODUCERS
|
||||||
from signal_aggregator import SignalAggregator, SignalReport
|
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()
|
_APP = get_app_config()
|
||||||
|
|
||||||
|
|||||||
+2
-5
@@ -12,8 +12,7 @@ import threading
|
|||||||
import tempfile
|
import tempfile
|
||||||
import traceback
|
import traceback
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timedelta, timezone
|
||||||
from unittest.mock import patch, MagicMock
|
from unittest.mock import patch
|
||||||
from io import StringIO
|
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
@@ -1489,7 +1488,7 @@ print("\n═══ Module 6: main.py ═══")
|
|||||||
|
|
||||||
from main import (
|
from main import (
|
||||||
signal_color, quality_color, _compact_reason,
|
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")
|
@test("CP: cp_patterns subset filter excludes disabled detectors")
|
||||||
def _():
|
def _():
|
||||||
from dataclasses import replace
|
|
||||||
df = make_cp_df(double_bottom_closes())
|
df = make_cp_df(double_bottom_closes())
|
||||||
cfg = XauStrategyConfig(cp_patterns=["bull_flag"])
|
cfg = XauStrategyConfig(cp_patterns=["bull_flag"])
|
||||||
assert detect_chart_pattern(df, atr=5.0, cfg=cfg) is None
|
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")
|
@test("signal_log: analyze_pair weekend early-return is logged")
|
||||||
def _():
|
def _():
|
||||||
import signal_log as slog
|
import signal_log as slog
|
||||||
from signal_aggregator import _is_forex_weekend
|
|
||||||
fd, path = tempfile.mkstemp(suffix=".db")
|
fd, path = tempfile.mkstemp(suffix=".db")
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
|
|||||||
Reference in New Issue
Block a user