From 193de7d4877d4f3d6f9bd523096cb62c54806b5a Mon Sep 17 00:00:00 2001 From: Rike-Benjamin Schuppner Date: Tue, 15 Apr 2025 13:07:09 +0200 Subject: [PATCH] nan values are not allowed anymore; remove our own private equal function Abstain voting was removed in #22 making this superfluous. --- grader/grader.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/grader/grader.py b/grader/grader.py index e5d9f84..1d3682f 100755 --- a/grader/grader.py +++ b/grader/grader.py @@ -160,18 +160,6 @@ def format_have_applied(person, width=3): 'OVERQUALIFIED': -650, } -def equal(a, b): - # Fuck people who designed this nan != nan crap. - # Fuck people who implemented it in Python like blind sheep. - if isinstance(a, float) and isinstance(b, float): - if np.isnan(a) == np.isnan(b): - return True - if np.isnan(a) != np.isnan(b): - return False - # use normal comparison otherwise - return a == b - - class GradingMoves(enum.Enum): BACK = enum.auto() SKIP = enum.auto() @@ -738,7 +726,7 @@ def is_valid_score(choice): case _: print('illegal value: {}'.format(choice)) - if not equal(valid_choice, default): + if valid_choice != default: self._set_grading(person, valid_choice) return GradingMoves.NEXT