tests optimize load_data
This commit is contained in:
@@ -88,6 +88,12 @@ def download_pairs(datadir, pairs: List[str]) -> bool:
|
||||
return True
|
||||
|
||||
|
||||
def file_dump_json(filename, data):
|
||||
with open(filename, "wt") as fp:
|
||||
json.dump(data, fp)
|
||||
|
||||
|
||||
# FIX: 20180110, suggest rename interval to tick_interval
|
||||
def download_backtesting_testdata(datadir: str, pair: str, interval: int = 5) -> bool:
|
||||
"""
|
||||
Download the latest 1 and 5 ticker intervals from Bittrex for the pairs passed in parameters
|
||||
@@ -127,7 +133,6 @@ def download_backtesting_testdata(datadir: str, pair: str, interval: int = 5) ->
|
||||
logger.debug("New End: {}".format(data[-1:][0]['T']))
|
||||
data = sorted(data, key=lambda data: data['T'])
|
||||
|
||||
with open(filename, "wt") as fp:
|
||||
json.dump(data, fp)
|
||||
file_dump_json(filename, data)
|
||||
|
||||
return True
|
||||
|
Reference in New Issue
Block a user