style: apply black/ruff formatting fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e15e2df7a5
commit
f87197ef41
|
|
@ -13,7 +13,6 @@ Usage:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
@ -59,9 +58,9 @@ def main():
|
||||||
# Summary
|
# Summary
|
||||||
n_tickers = len(data)
|
n_tickers = len(data)
|
||||||
total_rows = sum(len(df) for df in data.values())
|
total_rows = sum(len(df) for df in data.values())
|
||||||
cache_size_mb = sum(
|
cache_size_mb = (
|
||||||
p.stat().st_size for p in Path(args.cache_dir).glob("*.parquet")
|
sum(p.stat().st_size for p in Path(args.cache_dir).glob("*.parquet")) / 1024 / 1024
|
||||||
) / 1024 / 1024
|
)
|
||||||
|
|
||||||
print(f"\nDone in {elapsed:.1f}s", flush=True)
|
print(f"\nDone in {elapsed:.1f}s", flush=True)
|
||||||
print(f" Tickers cached : {n_tickers}/{len(tickers)}", flush=True)
|
print(f" Tickers cached : {n_tickers}/{len(tickers)}", flush=True)
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,6 @@ class InsiderBuyingScanner(BaseScanner):
|
||||||
logger.error(f"Insider buying scan failed: {e}", exc_info=True)
|
logger.error(f"Insider buying scan failed: {e}", exc_info=True)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def _load_recent_insider_tickers(self, suppress_days: int = 2) -> Set[str]:
|
def _load_recent_insider_tickers(self, suppress_days: int = 2) -> Set[str]:
|
||||||
"""Return tickers recommended as insider_buying in the past N days.
|
"""Return tickers recommended as insider_buying in the past N days.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,9 @@ class MinerviniScanner(BaseScanner):
|
||||||
tickers = tickers[: self.max_tickers]
|
tickers = tickers[: self.max_tickers]
|
||||||
|
|
||||||
cache_dir = self.config.get("discovery", {}).get("ohlcv_cache_dir", "data/ohlcv_cache")
|
cache_dir = self.config.get("discovery", {}).get("ohlcv_cache_dir", "data/ohlcv_cache")
|
||||||
logger.info(f"Loading OHLCV for {len(tickers)} tickers from cache ({self.lookback_period})...")
|
logger.info(
|
||||||
|
f"Loading OHLCV for {len(tickers)} tickers from cache ({self.lookback_period})..."
|
||||||
|
)
|
||||||
data = download_ohlcv_cached(tickers, period=self.lookback_period, cache_dir=cache_dir)
|
data = download_ohlcv_cached(tickers, period=self.lookback_period, cache_dir=cache_dir)
|
||||||
|
|
||||||
if not data:
|
if not data:
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ SECTOR_ETFS = {
|
||||||
"XLC": "Communication Services",
|
"XLC": "Communication Services",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class SectorRotationScanner(BaseScanner):
|
class SectorRotationScanner(BaseScanner):
|
||||||
"""Detect sector momentum shifts and find laggards in accelerating sectors."""
|
"""Detect sector momentum shifts and find laggards in accelerating sectors."""
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue