From 12aa76f0a08e5b702d927eed7185a87277af2b51 Mon Sep 17 00:00:00 2001 From: "C. Titus Brown" Date: Thu, 23 Aug 2018 10:16:25 -0700 Subject: [PATCH] fix print_results output of compare to print out symmetric matrix (#536) --- sourmash/commands.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sourmash/commands.py b/sourmash/commands.py index ad13a4d30a..ddee5ac411 100644 --- a/sourmash/commands.py +++ b/sourmash/commands.py @@ -399,15 +399,16 @@ def compare(args): D[i][j] = similarity D[j][i] = similarity - if len(siglist) < 30: + labeltext.append(E.name()) + + if len(siglist) < 30: + for i, E in enumerate(siglist): # for small matrices, pretty-print some output name_num = '{}-{}'.format(i, E.name()) if len(name_num) > 20: name_num = name_num[:17] + '...' print_results('{:20s}\t{}'.format(name_num, D[i, :, ],)) - labeltext.append(E.name()) - print_results('min similarity in matrix: {:.3f}', numpy.min(D)) # shall we output a matrix?