summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-04-08 15:33:01 +0200
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-04-08 15:33:01 +0200
commit43fba1c1e2938b5160df5dd973f168504826facf (patch)
tree1db71433745c6004972eb1614c9d09b6b8ccb1ed
parentb35f019d0bf65ff3c096b354ef5ad19cc83faba7 (diff)
Fix monkey.test to match monkey.edits updates
-rwxr-xr-xmonkey/test.py10
1 files 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))