Skip to content

Commit

Permalink
Only show rank when every pair is compared
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyingwucl committed Jan 21, 2025
1 parent ed7a5e1 commit 154940c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/shortlister/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,14 @@ def export_applicants_excel(self, k=None):
print()

def rank_selected_applicants(self, k=None):
result = tournament.get_existing_result(
Path(tournament.COMPARISON_RESULT_FILE_NAME)
)
result = tournament.comparison(self.ctx.applicants, result)

ranked_pickle_path = self.path/Path(tournament.COMPARISON_RESULT_FILE_NAME)
result = tournament.get_existing_result(ranked_pickle_path)
new_result = tournament.comparison(self.ctx.applicants, result)

tournament.save_rank(new_result,ranked_pickle_path)
# Condition to avoid exception (caused by empty result when quitting comparison with "q")
if result:
if not tournament.get_pair(self.ctx.applicants,new_result):
ranked_list = tournament.rank(self.ctx.applicants, result)
print("RESULT:", [applicant.name for applicant in ranked_list])
print()
Expand Down

0 comments on commit 154940c

Please sign in to comment.