reformat code

This commit is contained in:
Yinon Polak 2023-03-06 17:56:07 +02:00
parent e6e747bcd8
commit 7eedcb9c14

View File

@ -24,6 +24,7 @@ from freqtrade.exceptions import OperationalException
from freqtrade.freqai.data_kitchen import FreqaiDataKitchen from freqtrade.freqai.data_kitchen import FreqaiDataKitchen
from freqtrade.strategy.interface import IStrategy from freqtrade.strategy.interface import IStrategy
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -89,8 +90,8 @@ class FreqaiDataDrawer:
self.metric_tracker_lock = threading.Lock() self.metric_tracker_lock = threading.Lock()
self.old_DBSCAN_eps: Dict[str, float] = {} self.old_DBSCAN_eps: Dict[str, float] = {}
self.empty_pair_dict: pair_info = { self.empty_pair_dict: pair_info = {
"model_filename": "", "trained_timestamp": 0, "model_filename": "", "trained_timestamp": 0,
"data_path": "", "extras": {}} "data_path": "", "extras": {}}
self.model_type = self.freqai_info.get('model_save_type', 'joblib') self.model_type = self.freqai_info.get('model_save_type', 'joblib')
def update_metric_tracker(self, metric: str, value: float, pair: str) -> None: def update_metric_tracker(self, metric: str, value: float, pair: str) -> None:
@ -580,16 +581,16 @@ class FreqaiDataDrawer:
if len(df_dp.index) == 0: if len(df_dp.index) == 0:
continue continue
if str(hist_df.iloc[-1]["date"]) == str( if str(hist_df.iloc[-1]["date"]) == str(
df_dp.iloc[-1:]["date"].iloc[-1] df_dp.iloc[-1:]["date"].iloc[-1]
): ):
continue continue
try: try:
index = ( index = (
df_dp.loc[ df_dp.loc[
df_dp["date"] == hist_df.iloc[-1]["date"] df_dp["date"] == hist_df.iloc[-1]["date"]
].index[0] ].index[0]
+ 1 + 1
) )
except IndexError: except IndexError:
if hist_df.iloc[-1]['date'] < df_dp['date'].iloc[0]: if hist_df.iloc[-1]['date'] < df_dp['date'].iloc[0]:
@ -642,7 +643,7 @@ class FreqaiDataDrawer:
) )
def get_base_and_corr_dataframes( def get_base_and_corr_dataframes(
self, timerange: TimeRange, pair: str, dk: FreqaiDataKitchen self, timerange: TimeRange, pair: str, dk: FreqaiDataKitchen
) -> Tuple[Dict[Any, Any], Dict[Any, Any]]: ) -> Tuple[Dict[Any, Any], Dict[Any, Any]]:
""" """
Searches through our historic_data in memory and returns the dataframes relevant Searches through our historic_data in memory and returns the dataframes relevant