Commit 033c2bfd authored by Lachlan's avatar Lachlan

WIP - Add function to turn unique node dictionarys into json format

parent 047c9659
Pipeline #70119406 passed with stages
in 64 minutes and 24 seconds
......@@ -28,6 +28,7 @@ import re
import io
import ast
import statistics
import json
from collections import namedtuple
from typing import Dict, Tuple
......@@ -544,3 +545,13 @@ class Tree():
def print_trees(self):
for tree in self._trees:
Tree.print_time_tree(tree)
@property
def to_json(self, tree: Dict[UniqueNode, TimeNode] = None) -> 'json':
"""WIP - Convert tree """
if not tree:
_tree = Tree.accumulate_trees(self._trees)
else:
_tree = tree
return json.dumps(_tree)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment