removed candle type from idatahandler.py

This commit is contained in:
Sam Germain 2021-11-20 22:43:25 -06:00
parent c3b2929e75
commit b4029533ec

View File

@ -39,7 +39,7 @@ class IDataHandler(ABC):
cls, cls,
datadir: Path, datadir: Path,
timeframe: str, timeframe: str,
candle_type: Optional[str] = "" candle_type: Optional[str] = ''
) -> List[str]: ) -> List[str]:
""" """
Returns a list of all pairs with ohlcv data available in this datadir Returns a list of all pairs with ohlcv data available in this datadir
@ -55,7 +55,7 @@ class IDataHandler(ABC):
pair: str, pair: str,
timeframe: str, timeframe: str,
data: DataFrame, data: DataFrame,
candle_type: Optional[str] = "" candle_type: Optional[str] = ''
) -> None: ) -> None:
""" """
Store ohlcv data. Store ohlcv data.
@ -68,7 +68,7 @@ class IDataHandler(ABC):
@abstractmethod @abstractmethod
def _ohlcv_load(self, pair: str, timeframe: str, def _ohlcv_load(self, pair: str, timeframe: str,
timerange: Optional[TimeRange] = None, timerange: Optional[TimeRange] = None,
candle_type: Optional[str] = "" candle_type: Optional[str] = ''
) -> DataFrame: ) -> DataFrame:
""" """
Internal method used to load data for one pair from disk. Internal method used to load data for one pair from disk.
@ -83,7 +83,7 @@ class IDataHandler(ABC):
""" """
@abstractmethod @abstractmethod
def ohlcv_purge(self, pair: str, timeframe: str, candle_type: Optional[str] = "") -> bool: def ohlcv_purge(self, pair: str, timeframe: str, candle_type: Optional[str] = '') -> bool:
""" """
Remove data for this pair Remove data for this pair
:param pair: Delete data for this pair. :param pair: Delete data for this pair.
@ -97,7 +97,7 @@ class IDataHandler(ABC):
pair: str, pair: str,
timeframe: str, timeframe: str,
data: DataFrame, data: DataFrame,
candle_type: Optional[str] = "" candle_type: Optional[str] = ''
) -> None: ) -> None:
""" """
Append data to existing data structures Append data to existing data structures
@ -165,7 +165,7 @@ class IDataHandler(ABC):
drop_incomplete: bool = True, drop_incomplete: bool = True,
startup_candles: int = 0, startup_candles: int = 0,
warn_no_data: bool = True, warn_no_data: bool = True,
candle_type: Optional[str] = "" candle_type: Optional[str] = ''
) -> DataFrame: ) -> DataFrame:
""" """
Load cached candle (OHLCV) data for the given pair. Load cached candle (OHLCV) data for the given pair.
@ -190,7 +190,7 @@ class IDataHandler(ABC):
timerange=timerange_startup, timerange=timerange_startup,
candle_type=candle_type candle_type=candle_type
) )
if self._check_empty_df(pairdf, pair, timeframe, warn_no_data, candle_type): if self._check_empty_df(pairdf, pair, timeframe, warn_no_data):
return pairdf return pairdf
else: else:
enddate = pairdf.iloc[-1]['date'] enddate = pairdf.iloc[-1]['date']
@ -202,8 +202,7 @@ class IDataHandler(ABC):
pairdf, pairdf,
pair, pair,
timeframe, timeframe,
warn_no_data, warn_no_data
candle_type
): ):
return pairdf return pairdf
@ -213,7 +212,7 @@ class IDataHandler(ABC):
fill_missing=fill_missing, fill_missing=fill_missing,
drop_incomplete=(drop_incomplete and drop_incomplete=(drop_incomplete and
enddate == pairdf.iloc[-1]['date'])) enddate == pairdf.iloc[-1]['date']))
self._check_empty_df(pairdf, pair, timeframe, warn_no_data, candle_type=candle_type) self._check_empty_df(pairdf, pair, timeframe, warn_no_data)
return pairdf return pairdf
def _check_empty_df( def _check_empty_df(
@ -221,8 +220,7 @@ class IDataHandler(ABC):
pairdf: DataFrame, pairdf: DataFrame,
pair: str, pair: str,
timeframe: str, timeframe: str,
warn_no_data: bool, warn_no_data: bool
candle_type: Optional[str] = ""
): ):
""" """
Warn on empty dataframe Warn on empty dataframe
@ -240,8 +238,7 @@ class IDataHandler(ABC):
self, self,
pair, pair,
pairdata: DataFrame, pairdata: DataFrame,
timerange: TimeRange, timerange: TimeRange
candle_type: Optional[str] = ""
): ):
""" """
Validates pairdata for missing data at start end end and logs warnings. Validates pairdata for missing data at start end end and logs warnings.