From 34e7e3efea14e707b89bc95d02f7b725dceea9eb Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 17 Jun 2023 08:40:09 +0200 Subject: [PATCH] Simplify imports --- freqtrade/optimize/lookahead_analysis.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/freqtrade/optimize/lookahead_analysis.py b/freqtrade/optimize/lookahead_analysis.py index 65e9cad3f..889e43375 100755 --- a/freqtrade/optimize/lookahead_analysis.py +++ b/freqtrade/optimize/lookahead_analysis.py @@ -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/" - f"{self.local_config['freqai']['identifier']}").resolve()) + 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