From db03fbcb1c06eed951fe2ac7d6e9ff5097bcb7f7 Mon Sep 17 00:00:00 2001 From: Nick Hilton Date: Sat, 20 Feb 2016 19:01:07 -0800 Subject: [PATCH] fixed serious bug --- rank_photos.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rank_photos.py b/rank_photos.py index 44018a0..fb4d8dd 100755 --- a/rank_photos.py +++ b/rank_photos.py @@ -143,6 +143,10 @@ class Photo: data = np.rot90(data, 1) + elif r == 'Rotated 180': + + data = np.rot90(data, 2) + else: raise RuntimeError('Unhandled rotation "%s"' % r) @@ -316,10 +320,12 @@ class EloTable: d = Display(photo_a, photo_b, title, figsize) - if d == Photo.LEFT: + if d._choice == Photo.LEFT: self.__score_result(photo_a, photo_b) - else: + elif d._choice == Photo.RIGHT: self.__score_result(photo_b, photo_a) + else: + raise RuntimeError("oops, found a bug!") def __score_result(self, winning_photo, loosing_photo):