chore: remove dead code found in the v0.4.0 review

- inline _in_news_window, a trivial passthrough left from extracting
  dataflows.date_window.in_window; call in_window directly
- drop SignalProcessor's orphaned quick_thinking_llm attribute (unused since
  rating extraction became a deterministic parse)
This commit is contained in:
Yijia-Xiao
2026-08-31 01:29:14 +00:00
parent b43bc31479
commit a2f51da917
3 changed files with 14 additions and 18 deletions

View File

@@ -60,11 +60,6 @@ def _extract_article_data(article: dict) -> dict:
}
def _in_news_window(pub_date, start_dt, end_dt) -> bool:
"""Look-ahead-safe article-window check; see dataflows.date_window.in_window."""
return in_window(pub_date, start_dt, end_dt)
def get_news_yfinance(
ticker: str,
start_date: str,
@@ -105,7 +100,7 @@ def get_news_yfinance(
data = _extract_article_data(article)
# Keep only articles within the requested window (look-ahead safe).
if not _in_news_window(data["pub_date"], start_dt, end_dt):
if not in_window(data["pub_date"], start_dt, end_dt):
continue
news_str += f"### {data['title']} (source: {data['publisher']})\n"
@@ -192,7 +187,7 @@ def get_global_news_yfinance(
# Extract uniformly (flat + nested) and apply the same look-ahead-safe
# window filter, so flat articles can't leak future news (#1007).
data = _extract_article_data(article)
if not _in_news_window(data["pub_date"], start_dt, curr_dt):
if not in_window(data["pub_date"], start_dt, curr_dt):
continue
news_str += f"### {data['title']} (source: {data['publisher']})\n"
if data["summary"]:

View File

@@ -21,10 +21,10 @@ class SignalProcessor:
"""Read the 5-tier rating out of a Portfolio Manager decision."""
def __init__(self, quick_thinking_llm: Any = None):
# The LLM argument is accepted for backwards compatibility but no
# longer used: the PM's structured output guarantees the rating is
# parseable from the rendered markdown without a second LLM call.
self.quick_thinking_llm = quick_thinking_llm
# The LLM argument is accepted for backwards compatibility but ignored:
# the PM's structured output guarantees the rating is parseable from the
# rendered markdown without a second LLM call, so it is not stored.
pass
def process_signal(self, full_signal: str) -> str:
"""Return one of Buy / Overweight / Hold / Underweight / Sell, or REVIEW.