aboutsummaryrefslogtreecommitdiff
path: root/backend/data/trimTree.py
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-06-17 15:33:40 +1000
committerTerry Truong <terry06890@gmail.com>2022-06-17 15:33:40 +1000
commit6916e49e449461fbb9534ed51c70db6cf6d66f9f (patch)
treee00e75f122ccd79af64372eb6e56044ec215e60f /backend/data/trimTree.py
parent27c38b53728818361692f947cb71a7184d0c986b (diff)
Make reduced-tree a bit more inclusive
Diffstat (limited to 'backend/data/trimTree.py')
-rwxr-xr-xbackend/data/trimTree.py3
1 files changed, 2 insertions, 1 deletions
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 = {}