fixed serious bug

This commit is contained in:
Nick Hilton 2016-02-20 19:01:07 -08:00
parent 470559c392
commit db03fbcb1c
1 changed files with 8 additions and 2 deletions

View File

@ -143,6 +143,10 @@ class Photo:
data = np.rot90(data, 1) data = np.rot90(data, 1)
elif r == 'Rotated 180':
data = np.rot90(data, 2)
else: else:
raise RuntimeError('Unhandled rotation "%s"' % r) raise RuntimeError('Unhandled rotation "%s"' % r)
@ -316,10 +320,12 @@ class EloTable:
d = Display(photo_a, photo_b, title, figsize) d = Display(photo_a, photo_b, title, figsize)
if d == Photo.LEFT: if d._choice == Photo.LEFT:
self.__score_result(photo_a, photo_b) self.__score_result(photo_a, photo_b)
else: elif d._choice == Photo.RIGHT:
self.__score_result(photo_b, photo_a) self.__score_result(photo_b, photo_a)
else:
raise RuntimeError("oops, found a bug!")
def __score_result(self, winning_photo, loosing_photo): def __score_result(self, winning_photo, loosing_photo):