tests optimize load_data

This commit is contained in:
kryofly
2018-01-10 12:00:00 +01:00
parent 0cb57bee0e
commit f848a5c87d
2 changed files with 22 additions and 2 deletions

View File

@@ -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