Simplify small segment in datadrawer
This commit is contained in:
@@ -63,7 +63,7 @@ class FreqaiDataDrawer:
|
|||||||
self.historic_predictions: Dict[str, Any] = {}
|
self.historic_predictions: Dict[str, Any] = {}
|
||||||
self.follower_dict: Dict[str, Any] = {}
|
self.follower_dict: Dict[str, Any] = {}
|
||||||
self.full_path = full_path
|
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.follower_dict_path = Path(
|
||||||
self.full_path / f"follower_dictionary-{self.follower_name}.json"
|
self.full_path / f"follower_dictionary-{self.follower_name}.json"
|
||||||
)
|
)
|
||||||
@@ -159,8 +159,7 @@ class FreqaiDataDrawer:
|
|||||||
for pair in whitelist_pairs:
|
for pair in whitelist_pairs:
|
||||||
self.follower_dict[pair] = {}
|
self.follower_dict[pair] = {}
|
||||||
|
|
||||||
with open(self.follower_dict_path, "w") as fp:
|
self.save_follower_dict_to_disk()
|
||||||
json.dump(self.follower_dict, fp, default=self.np_encoder)
|
|
||||||
|
|
||||||
def np_encoder(self, object):
|
def np_encoder(self, object):
|
||||||
if isinstance(object, np.generic):
|
if isinstance(object, np.generic):
|
||||||
|
Reference in New Issue
Block a user