refactor: name the decision log module tradingagents/memory.py

- TradingMemoryLog imports from tradingagents.memory, matching the class, the memory_log_path key and graph.memory_log
This commit is contained in:
Yijia-Xiao
2026-09-24 18:45:44 +00:00
parent 73e0aa0fa6
commit 51066935b8
9 changed files with 14 additions and 14 deletions
+5 -5
View File
@@ -7,11 +7,11 @@ import pytest
from tradingagents.agents.managers.portfolio_manager import create_portfolio_manager
from tradingagents.agents.schemas import PortfolioDecision, PortfolioRating
from tradingagents.decision_log import TradingMemoryLog
from tradingagents.graph import settlement
from tradingagents.graph.propagation import Propagator
from tradingagents.graph.reflection import Reflector
from tradingagents.graph.trading_graph import TradingAgentsGraph
from tradingagents.memory import TradingMemoryLog
_SEP = TradingMemoryLog._SEPARATOR
@@ -863,12 +863,12 @@ class TestLegacyRemoval:
def test_financial_situation_memory_removed(self):
"""FinancialSituationMemory must not be importable from the memory module."""
import tradingagents.decision_log as m
import tradingagents.memory as m
assert not hasattr(m, "FinancialSituationMemory")
def test_bm25_not_imported(self):
"""rank_bm25 must not be present in the memory module namespace."""
import tradingagents.decision_log as m
import tradingagents.memory as m
assert not hasattr(m, "BM25Okapi")
def test_reflect_and_remember_removed(self):
@@ -934,8 +934,8 @@ class TestLegacyRemoval:
def test_a_failed_reflection_leaves_the_entry_pending_and_lets_the_run_start(tmp_path, monkeypatch):
"""Settling past decisions happens on the way into a new run, and reflection
calls an LLM. A transient failure there must not stop the new analysis."""
from tradingagents.decision_log import TradingMemoryLog
from tradingagents.graph.trading_graph import TradingAgentsGraph
from tradingagents.memory import TradingMemoryLog
graph = object.__new__(TradingAgentsGraph)
graph.config = {"memory_log_path": str(tmp_path / "m.md")}
@@ -967,8 +967,8 @@ def test_a_failed_reflection_leaves_the_entry_pending_and_lets_the_run_start(tmp
def test_the_holding_window_is_configurable(tmp_path, monkeypatch):
"""A decision written for months should not be graded at a week without the
operator choosing that window."""
from tradingagents.decision_log import TradingMemoryLog
from tradingagents.graph.trading_graph import TradingAgentsGraph
from tradingagents.memory import TradingMemoryLog
graph = object.__new__(TradingAgentsGraph)
graph.config = {"memory_log_path": str(tmp_path / "m.md"), "holding_period_days": 21}