Skip to content

Commit 10a9846

Browse files
committed
style: fix flake8 linting errors
1 parent 0ffd1aa commit 10a9846

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/quantrl_lab/data/crypto.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
import yfinance as yf
22
import pandas as pd
3-
from typing import Optional
43

54
def fetch_crypto_data(
6-
symbol: str = "BTC-USD",
7-
period: str = "2y",
5+
symbol: str = "BTC-USD",
6+
period: str = "2y",
87
interval: str = "1d"
98
) -> pd.DataFrame:
109
"""
11-
Fetches historical crypto data from Yahoo Finance and formats it
10+
Fetches historical crypto data from Yahoo Finance and formats it
1211
specifically for the QuantRL-Lab environment.
13-
12+
1413
Args:
1514
symbol: The cryptocurrency ticker (e.g., 'BTC-USD', 'ETH-USD').
1615
period: Data period to download (e.g., '1mo', '1y', 'max').
1716
interval: Data interval (e.g., '1d', '1h', '15m').
18-
17+
1918
Returns:
2019
pd.DataFrame: OHLCV dataframe formatted with float32 for RL agents.
2120
"""
2221
ticker = yf.Ticker(symbol)
2322
df = ticker.history(period=period, interval=interval)
24-
23+
2524
if df.empty:
2625
raise ValueError(f"No data found for symbol {symbol}. Check if the ticker is correct.")
2726

@@ -37,4 +36,4 @@ def fetch_crypto_data(
3736
df.index = df.index.tz_localize(None)
3837

3938
# Cast to float32 for Neural Network memory efficiency
40-
return df.astype("float32")
39+
return df.astype("float32")

0 commit comments

Comments
 (0)