Skip to content

Commit

Permalink
test import then export
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasbtnfr committed Mar 21, 2023
1 parent d7dd8f3 commit f17c0df
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 18 additions & 1 deletion skmine/periodic/cycles.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def export_patterns(self, file="patterns.json"):
# allows us to call export_patterns without explicitly calling discover method before
self.discover()

big_dict_list = [json.loads(i) for i in self.cycles["pattern_json_tree"].values]
big_dict_list = [i for i in self.cycles["pattern_json_tree"].values]

data_dict = self.alpha_groups.copy()
for k, v in data_dict.items():
Expand Down Expand Up @@ -416,4 +416,21 @@ def get_residuals(self, *patterns_id, sort="time"):


def draw_pattern(self, pattern_id):
"""
TODO
Parameters
----------
pattern_id
Returns
-------
"""
pattern = self.cycles.loc[pattern_id]["pattern_json_tree"]
# map each event id to its real textual name
for nid in pattern.keys():
if isinstance(nid, int):
if "event" in pattern[nid].keys():
pattern[nid]["event"] = list(self.data_details.map_ev_num.keys())[int(pattern[nid]["event"])]
return draw_pattern(self.cycles.loc[pattern_id]["pattern_json_tree"])
1 change: 1 addition & 0 deletions skmine/periodic/pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def codeLengthE(E):

def draw_pattern(json_pattern):
"""
TODO
Parameters
----------
Expand Down

0 comments on commit f17c0df

Please sign in to comment.