Simplify imports

This commit is contained in:
Matthias
2023-06-17 08:40:09 +02:00
parent 2c7aa9f721
commit 34e7e3efea

View File

@@ -1,9 +1,8 @@
import copy
import logging
import pathlib
import shutil
from copy import deepcopy
from datetime import datetime, timedelta, timezone
from pathlib import Path
from typing import Any, Dict, List, Optional
import pandas as pd
@@ -134,14 +133,13 @@ class LookaheadAnalysis:
# purge previous data if the freqai model is defined
# (to be sure nothing is carried over from older backtests)
path_to_current_identifier = (
pathlib.Path(f"{self.local_config['user_data_dir']}"
"/models/"
Path(f"{self.local_config['user_data_dir']}/models/"
f"{self.local_config['freqai']['identifier']}").resolve())
# 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)
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)) + "-" +
str(self.dt_to_timestamp(varholder.to_dt)))
prepare_data_config['exchange']['pair_whitelist'] = pairs_to_load