Simplify imports
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
import copy
|
|
||||||
import logging
|
import logging
|
||||||
import pathlib
|
|
||||||
import shutil
|
import shutil
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timedelta, timezone
|
||||||
|
from pathlib import Path
|
||||||
from typing import Any, Dict, List, Optional
|
from typing import Any, Dict, List, Optional
|
||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
@@ -134,14 +133,13 @@ class LookaheadAnalysis:
|
|||||||
# purge previous data if the freqai model is defined
|
# purge previous data if the freqai model is defined
|
||||||
# (to be sure nothing is carried over from older backtests)
|
# (to be sure nothing is carried over from older backtests)
|
||||||
path_to_current_identifier = (
|
path_to_current_identifier = (
|
||||||
pathlib.Path(f"{self.local_config['user_data_dir']}"
|
Path(f"{self.local_config['user_data_dir']}/models/"
|
||||||
"/models/"
|
f"{self.local_config['freqai']['identifier']}").resolve())
|
||||||
f"{self.local_config['freqai']['identifier']}").resolve())
|
|
||||||
# remove folder and its contents
|
# remove folder and its contents
|
||||||
if pathlib.Path.exists(path_to_current_identifier):
|
if Path.exists(path_to_current_identifier):
|
||||||
shutil.rmtree(path_to_current_identifier)
|
shutil.rmtree(path_to_current_identifier)
|
||||||
|
|
||||||
prepare_data_config = copy.deepcopy(self.local_config)
|
prepare_data_config = deepcopy(self.local_config)
|
||||||
prepare_data_config['timerange'] = (str(self.dt_to_timestamp(varholder.from_dt)) + "-" +
|
prepare_data_config['timerange'] = (str(self.dt_to_timestamp(varholder.from_dt)) + "-" +
|
||||||
str(self.dt_to_timestamp(varholder.to_dt)))
|
str(self.dt_to_timestamp(varholder.to_dt)))
|
||||||
prepare_data_config['exchange']['pair_whitelist'] = pairs_to_load
|
prepare_data_config['exchange']['pair_whitelist'] = pairs_to_load
|
||||||
|
|||||||
Reference in New Issue
Block a user