Revert unnecessary formatting changes

This commit is contained in:
Matthias
2021-11-28 15:53:13 +01:00
parent c20157e64f
commit cb4efa6d56
4 changed files with 12 additions and 53 deletions

View File

@@ -37,12 +37,7 @@ class HDF5DataHandler(IDataHandler):
if match and len(match.groups()) > 1]
@classmethod
def ohlcv_get_pairs(
cls,
datadir: Path,
timeframe: str,
candle_type: str = ''
) -> List[str]:
def ohlcv_get_pairs(cls, datadir: Path, timeframe: str, candle_type: str = '') -> List[str]:
"""
Returns a list of all pairs with ohlcv data available in this datadir
for the specified timeframe
@@ -88,8 +83,7 @@ class HDF5DataHandler(IDataHandler):
ds.close()
def _ohlcv_load(self, pair: str, timeframe: str,
timerange: Optional[TimeRange] = None,
candle_type: str = '') -> pd.DataFrame:
timerange: Optional[TimeRange] = None, candle_type: str = '') -> pd.DataFrame:
"""
Internal method used to load data for one pair from disk.
Implements the loading and conversion to a Pandas dataframe.

View File

@@ -38,12 +38,7 @@ class IDataHandler(ABC):
"""
@abstractclassmethod
def ohlcv_get_pairs(
cls,
datadir: Path,
timeframe: str,
candle_type: str = ''
) -> List[str]:
def ohlcv_get_pairs(cls, datadir: Path, timeframe: str, candle_type: str = '') -> List[str]:
"""
Returns a list of all pairs with ohlcv data available in this datadir
for the specified timeframe
@@ -217,12 +212,7 @@ class IDataHandler(ABC):
if timerange_startup:
self._validate_pairdata(pair, pairdf, timerange_startup)
pairdf = trim_dataframe(pairdf, timerange_startup)
if self._check_empty_df(
pairdf,
pair,
timeframe,
warn_no_data
):
if self._check_empty_df(pairdf, pair, timeframe, warn_no_data):
return pairdf
# incomplete candles should only be dropped if we didn't trim the end beforehand.
@@ -234,13 +224,7 @@ class IDataHandler(ABC):
self._check_empty_df(pairdf, pair, timeframe, warn_no_data)
return pairdf
def _check_empty_df(
self,
pairdf: DataFrame,
pair: str,
timeframe: str,
warn_no_data: bool
):
def _check_empty_df(self, pairdf: DataFrame, pair: str, timeframe: str, warn_no_data: bool):
"""
Warn on empty dataframe
"""
@@ -253,12 +237,7 @@ class IDataHandler(ABC):
return True
return False
def _validate_pairdata(
self,
pair,
pairdata: DataFrame,
timerange: TimeRange
):
def _validate_pairdata(self, pair, pairdata: DataFrame, timerange: TimeRange):
"""
Validates pairdata for missing data at start end end and logs warnings.
:param pairdata: Dataframe to validate

View File

@@ -37,12 +37,7 @@ class JsonDataHandler(IDataHandler):
if match and len(match.groups()) > 1]
@classmethod
def ohlcv_get_pairs(
cls,
datadir: Path,
timeframe: str,
candle_type: str = ''
) -> List[str]:
def ohlcv_get_pairs(cls, datadir: Path, timeframe: str, candle_type: str = '') -> List[str]:
"""
Returns a list of all pairs with ohlcv data available in this datadir
for the specified timeframe
@@ -78,12 +73,7 @@ class JsonDataHandler(IDataHandler):
:param candle_type: '', mark, index, premiumIndex, or funding_rate
:return: None
"""
filename = self._pair_data_filename(
self._datadir,
pair,
timeframe,
candle_type
)
filename = self._pair_data_filename(self._datadir, pair, timeframe, candle_type)
_data = data.copy()
# Convert date to int
_data['date'] = _data['date'].view(np.int64) // 1000 // 1000