From bc760b7eb236cc2fbec745c2f628755f33c2899d Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 26 Jul 2022 19:41:49 +0200 Subject: [PATCH] Simplify small segment in datadrawer --- freqtrade/freqai/data_drawer.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/freqtrade/freqai/data_drawer.py b/freqtrade/freqai/data_drawer.py index 8c26d01b0..5562ffba0 100644 --- a/freqtrade/freqai/data_drawer.py +++ b/freqtrade/freqai/data_drawer.py @@ -63,7 +63,7 @@ class FreqaiDataDrawer: self.historic_predictions: Dict[str, Any] = {} self.follower_dict: Dict[str, Any] = {} self.full_path = full_path - self.follower_name = self.config.get("bot_name", "follower1") + self.follower_name: str = self.config.get("bot_name", "follower1") self.follower_dict_path = Path( self.full_path / f"follower_dictionary-{self.follower_name}.json" ) @@ -159,8 +159,7 @@ class FreqaiDataDrawer: for pair in whitelist_pairs: self.follower_dict[pair] = {} - with open(self.follower_dict_path, "w") as fp: - json.dump(self.follower_dict, fp, default=self.np_encoder) + self.save_follower_dict_to_disk() def np_encoder(self, object): if isinstance(object, np.generic):