mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-30 09:02:58 +08:00
MAINT: Use logger instead of printing in loader.py
Makes it easier to filter logs when they're not desired.
This commit is contained in:
+14
-8
@@ -158,10 +158,13 @@ def load_market_data(trading_day=trading_day_nyse,
|
||||
try:
|
||||
saved_benchmarks = pd.Series.from_csv(bm_filepath)
|
||||
except (OSError, IOError):
|
||||
print("""
|
||||
data files aren't distributed with source.
|
||||
Fetching data from Yahoo Finance.
|
||||
""".strip())
|
||||
logger.info(
|
||||
"No cache found at {path}. "
|
||||
"Downloading benchmark data for '{symbol}'.",
|
||||
symbol=bm_symbol,
|
||||
path=bm_filepath,
|
||||
)
|
||||
|
||||
dump_benchmarks(bm_symbol)
|
||||
saved_benchmarks = pd.Series.from_csv(bm_filepath)
|
||||
|
||||
@@ -202,10 +205,13 @@ Fetching data from Yahoo Finance.
|
||||
try:
|
||||
saved_curves = pd.DataFrame.from_csv(tr_filepath)
|
||||
except (OSError, IOError):
|
||||
print("""
|
||||
data files aren't distributed with source.
|
||||
Fetching data from {0}
|
||||
""".format(source).strip())
|
||||
logger.info(
|
||||
"No cache found at {path}. "
|
||||
"Downloading treasury data from {source}.",
|
||||
path=tr_filepath,
|
||||
source=source,
|
||||
)
|
||||
|
||||
dump_treasury_curves(module, filename)
|
||||
saved_curves = pd.DataFrame.from_csv(tr_filepath)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user