Repository navigation
Pre-split prep: lazy-import finance deps in alphapy/data.py - #6
Conversation
Pre-split prep: removes the only module-level finance imports in the ML core. yfinance, AlpacaDataSource, and PolygonDataSource are now imported inside the functions that use them (get_yahoo_data, get_alpaca_data, get_polygon_data). This lets alphapy-pro import cleanly without yfinance/alpaca-py/ polygon-api-client installed, which is required for the upcoming alphapy-finance split where those packages live downstream. Verified: tests/test_imports.py, tests/test_utilities.py, tests/test_version.py all pass (18 passed, 1 skipped).
|
Claude finished @mrconway's task —— View job PR Review: Lazy-import finance deps in alphapy/data.pyTodo List:
Review SummaryThis PR successfully implements lazy imports for finance dependencies ( ✅ StrengthsCode Quality & Best Practices
Performance Considerations
|
Summary
First step of the alphapy-finance split (see plan: `docs/PLAN-split.md` not yet committed; tracked at `~/.claude/plans/okay-we-have-a-snappy-clock.md`).
Removes the only module-level finance imports in the ML core: `yfinance` and `AlpacaDataSource/PolygonDataSource` from `alphapy.data_sources`. They are now imported inside the three functions that use them.
This means `import alphapy` no longer requires yfinance, alpaca-py, or polygon-api-client. Required for the upcoming split where those deps live in alphapy-finance downstream.
Test plan