From 6916e49e449461fbb9534ed51c70db6cf6d66f9f Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Fri, 17 Jun 2022 15:33:40 +1000 Subject: Make reduced-tree a bit more inclusive --- backend/data/trimTree.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'backend/data/trimTree.py') diff --git a/backend/data/trimTree.py b/backend/data/trimTree.py index 2642ca0..65e44e4 100755 --- a/backend/data/trimTree.py +++ b/backend/data/trimTree.py @@ -43,6 +43,7 @@ for name in nodesToKeep: parent = row[0] if parent not in nodesToKeep and parent not in ancestors: ancestors.add(parent) + name = parent continue break nodesToKeep.update(ancestors) @@ -50,7 +51,7 @@ print(f"Total of {len(nodesToKeep)} nodes to keep") # Find root node query = "SELECT name FROM nodes LEFT JOIN edges ON nodes.name = edges.child WHERE edges.node IS NULL LIMIT 1" (rootName,) = dbCur.execute(query).fetchone() -print(f"Found root node \"{rootName\"}") +print(f"Found root node '{rootName}'") # Traverse tree, looking for trimmable nodes print("Looking for trimmable nodes") nodeToTipsChg = {} -- cgit v1.2.3