From 25bca3647522978197488d90c1d78312dc02ec8d Mon Sep 17 00:00:00 2001 From: Luiz Irber Date: Thu, 29 Mar 2018 17:20:53 -0700 Subject: [PATCH] small cleanups --- sourmash/commands.py | 1 - sourmash/sbt.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sourmash/commands.py b/sourmash/commands.py index 1c7b9c6ff8..7380223914 100644 --- a/sourmash/commands.py +++ b/sourmash/commands.py @@ -710,7 +710,6 @@ def index(args): sys.exit(-1) notify('loaded {} sigs; saving SBT under "{}"', n, args.sbt_name) - tree._fill_internal() tree.save(args.sbt_name, sparseness=args.sparseness) diff --git a/sourmash/sbt.py b/sourmash/sbt.py index 3ca2d1fccf..ab7acdad7a 100644 --- a/sourmash/sbt.py +++ b/sourmash/sbt.py @@ -388,7 +388,7 @@ def save(self, path, storage=None, sparseness=0.0): nodes = {} leaves = {} - total_nodes = len(self._nodes) + len(self._leaves) + total_nodes = len(self) for n, (i, node) in enumerate(self): if node is None: continue @@ -661,7 +661,7 @@ def fill_nodegraphs(node, *args, **kwargs): self.is_ready = True def _fill_up(self, search_fn, *args, **kwargs): - visited, queue = set(), list(reversed(list(self._leaves.keys()))) + visited, queue = set(), list(reversed(sorted(self._leaves.keys()))) while queue: node_p = queue.pop(0) @@ -706,7 +706,7 @@ def print_dot(self): edge [arrowsize=0.8]; """) - for i, node in list(self._nodes.items()): + for i, node in self._nodes.items(): if isinstance(node, Node): print('"{}" [shape=box fillcolor=gray style=filled]'.format( node.name))