Use pair-reconstruction method wherever possible
This commit is contained in:
parent
5b67be06c2
commit
f1c5a4d065
@ -66,7 +66,7 @@ class HDF5DataHandler(IDataHandler):
|
|||||||
_tmp = [re.search(r'^(\S+)(?=\-' + timeframe + candle + '.h5)', p.name)
|
_tmp = [re.search(r'^(\S+)(?=\-' + timeframe + candle + '.h5)', p.name)
|
||||||
for p in datadir.glob(f"*{timeframe}{candle}.h5")]
|
for p in datadir.glob(f"*{timeframe}{candle}.h5")]
|
||||||
# Check if regex found something and only return these results
|
# Check if regex found something and only return these results
|
||||||
return [match[0].replace('_', '/') for match in _tmp if match]
|
return [cls.rebuild_pair_from_filename(match[0]) for match in _tmp if match]
|
||||||
|
|
||||||
def ohlcv_store(
|
def ohlcv_store(
|
||||||
self,
|
self,
|
||||||
@ -160,7 +160,7 @@ class HDF5DataHandler(IDataHandler):
|
|||||||
_tmp = [re.search(r'^(\S+)(?=\-trades.h5)', p.name)
|
_tmp = [re.search(r'^(\S+)(?=\-trades.h5)', p.name)
|
||||||
for p in datadir.glob("*trades.h5")]
|
for p in datadir.glob("*trades.h5")]
|
||||||
# Check if regex found something and only return these results to avoid exceptions.
|
# Check if regex found something and only return these results to avoid exceptions.
|
||||||
return [match[0].replace('_', '/') for match in _tmp if match]
|
return [cls.rebuild_pair_from_filename(match[0]) for match in _tmp if match]
|
||||||
|
|
||||||
def trades_store(self, pair: str, data: TradeList) -> None:
|
def trades_store(self, pair: str, data: TradeList) -> None:
|
||||||
"""
|
"""
|
||||||
|
@ -67,7 +67,7 @@ class JsonDataHandler(IDataHandler):
|
|||||||
_tmp = [re.search(r'^(\S+)(?=\-' + timeframe + candle + '.json)', p.name)
|
_tmp = [re.search(r'^(\S+)(?=\-' + timeframe + candle + '.json)', p.name)
|
||||||
for p in datadir.glob(f"*{timeframe}{candle}.{cls._get_file_extension()}")]
|
for p in datadir.glob(f"*{timeframe}{candle}.{cls._get_file_extension()}")]
|
||||||
# Check if regex found something and only return these results
|
# Check if regex found something and only return these results
|
||||||
return [match[0].replace('_', '/') for match in _tmp if match]
|
return [cls.rebuild_pair_from_filename(match[0]) for match in _tmp if match]
|
||||||
|
|
||||||
def ohlcv_store(
|
def ohlcv_store(
|
||||||
self,
|
self,
|
||||||
@ -156,7 +156,7 @@ class JsonDataHandler(IDataHandler):
|
|||||||
_tmp = [re.search(r'^(\S+)(?=\-trades.json)', p.name)
|
_tmp = [re.search(r'^(\S+)(?=\-trades.json)', p.name)
|
||||||
for p in datadir.glob(f"*trades.{cls._get_file_extension()}")]
|
for p in datadir.glob(f"*trades.{cls._get_file_extension()}")]
|
||||||
# Check if regex found something and only return these results to avoid exceptions.
|
# Check if regex found something and only return these results to avoid exceptions.
|
||||||
return [match[0].replace('_', '/') for match in _tmp if match]
|
return [cls.rebuild_pair_from_filename(match[0]) for match in _tmp if match]
|
||||||
|
|
||||||
def trades_store(self, pair: str, data: TradeList) -> None:
|
def trades_store(self, pair: str, data: TradeList) -> None:
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user