From a83bf43ab9ed8c006827d3a966b3279ce24330f3 Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Sat, 6 Jul 2019 16:27:51 +0200 Subject: [PATCH] obi stats: result display is now sorted --- python/obitools3/commands/stats.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/obitools3/commands/stats.pyx b/python/obitools3/commands/stats.pyx index 07c8edf..e6e79f6 100755 --- a/python/obitools3/commands/stats.pyx +++ b/python/obitools3/commands/stats.pyx @@ -244,7 +244,9 @@ def run(config): "\t count" + \ "\t total" print(hcat) - for c in catcount: + sorted_stats = sorted(catcount.items(), key = lambda kv:(kv[1], kv[0]), reverse=True) + for i in range(len(sorted_stats)): + c = sorted_stats[i][0] for v in c: print(pcat % str(v)+"\t", end="") for m in config['stats']['minimum']: