From 43fba1c1e2938b5160df5dd973f168504826facf Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Fri, 8 Apr 2016 15:33:01 +0200 Subject: Fix monkey.test to match monkey.edits updates --- monkey/test.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/monkey/test.py b/monkey/test.py index bb49948..9267782 100755 --- a/monkey/test.py +++ b/monkey/test.py @@ -144,13 +144,9 @@ elif sys.argv[2] == 'info': # Print all observed edits and their costs. elif sys.argv[3] == 'edits': - for (path, before, after), cost in sorted(edits.items(), key=lambda x: x[1]): + for (path, before, after), (cost, uids) in sorted(edits.items(), key=lambda x: x[1]): print(' {:.4f}\t{} → {}'.format(cost, stringify(before) if before else 'ε', stringify(after) if after else 'ε')) - # Print all observed edits and their costs. - elif sys.argv[3] == 'names': - for name, count in sorted(names.items(), key=lambda x: x[1]): - print(' {:.4f}\t{}'.format(count, name)) # Print all student queries and their counts. elif sys.argv[3] == 'queries': @@ -162,6 +158,6 @@ elif sys.argv[2] == 'info': which = None if len(sys.argv) > 4: which = sys.argv[4] == 'good' - for (code, correct), count in submissions.most_common(): + for (code, correct), uids in reversed(sorted(submissions.items(), key=lambda x: len(x[1]))): if which is None or correct == which: - print('{}\t{}'.format(count, code)) + print('{}\t{}'.format(len(uids), code)) -- cgit v1.2.1