refactor(dataflows): name the shared modules by what they hold

- interface -> router; symbol_utils -> symbols, which also takes safe_ticker_component
- utils is split: get_current_date to date_window, the HTTP helpers to net
- dataflows imports are absolute; the NoMarketDataError re-export from symbols is gone
This commit is contained in:
Yijia-Xiao
2026-09-24 04:31:05 +00:00
parent a58aa613fc
commit c42a2f2c61
47 changed files with 217 additions and 219 deletions
+4 -4
View File
@@ -12,7 +12,7 @@ import requests
import tradingagents.dataflows.config as config_module
import tradingagents.default_config as default_config
from tradingagents.dataflows import interface, polymarket
from tradingagents.dataflows import polymarket, router
from tradingagents.dataflows.config import set_config
@@ -112,16 +112,16 @@ class PolymarketRoutingTests(unittest.TestCase):
def test_category_routes_to_polymarket(self):
self.assertEqual(
interface.get_category_for_method("get_prediction_markets"),
router.get_category_for_method("get_prediction_markets"),
"prediction_markets",
)
set_config({"data_vendors": {"prediction_markets": "polymarket"}})
with mock.patch.dict(
interface.VENDOR_METHODS,
router.VENDOR_METHODS,
{"get_prediction_markets": {"polymarket": lambda *a, **k: "POLY_OK"}},
clear=False,
):
out = interface.route_to_vendor("get_prediction_markets", "fed", 5)
out = router.route_to_vendor("get_prediction_markets", "fed", 5)
self.assertEqual(out, "POLY_OK")