Skip to content

Commit

Permalink
Merge pull request #1676 from codalab/develop
Browse files Browse the repository at this point in the history
Patch the removal of submissions counter on leaderboard (#1675)
  • Loading branch information
Didayolo authored Nov 19, 2024
2 parents 0111400 + c6a3deb commit 7b907be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/apps/api/views/competitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@ def get_leaderboard(self, request, pk):
# - child submissions (submissions who has a parent i.e. parent field is not null)
# - Failed submissions
# - Cancelled submissions
num_entries = 1 # TMP, remove counting
# num_entries = Submission.objects.filter(
# Q(owner__username=submission['owner']) |
# Q(parent__owner__username=submission['owner']),
Expand Down Expand Up @@ -737,7 +738,7 @@ def get_leaderboard(self, request, pk):
'fact_sheet_answers': submission['fact_sheet_answers'],
'slug_url': submission['slug_url'],
'organization': submission['organization'],
# 'num_entries': num_entries,
'num_entries': num_entries,
'created_when': submission['created_when']
})
for score in submission['scores']:
Expand Down
2 changes: 2 additions & 0 deletions src/static/riot/competitions/detail/leaderboards.tag
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<tr>
<th class="center aligned">#</th>
<th>Participant</th>
<th>Entries</th>
<th>Date</th>
<th>ID</th>
<th each="{ column in filtered_columns }" colspan="1">{column.title}</th>
Expand Down Expand Up @@ -82,6 +83,7 @@
</td>
<td if="{submission.organization === null}"><a href="{submission.slug_url}">{ submission.owner }</a></td>
<td if="{submission.organization !== null}"><a href="{submission.organization.url}">{ submission.organization.name }</a></td>
<td>{submission.num_entries}</td>
<td>{ pretty_date(submission.created_when) }</td>
<td>{submission.id}</td>
<td each="{ column in filtered_columns }">
Expand Down
2 changes: 1 addition & 1 deletion src/tests/functional/test_submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _run_submission_and_add_to_leaderboard(self, competition_zip_path, submissio

# The leaderboard table lists our submission
prediction_score = Submission.objects.get(pk=submission_id).scores.first().score
assert Decimal(self.find('leaderboards table tbody tr:nth-of-type(1) td:nth-of-type(5)').text) == round(Decimal(prediction_score), precision)
assert Decimal(self.find('leaderboards table tbody tr:nth-of-type(1) td:nth-of-type(6)').text) == round(Decimal(prediction_score), precision)

def test_v15_iris_result_submission_end_to_end(self):
self._run_submission_and_add_to_leaderboard('competition_15_iris.zip', 'submission_15_iris_result.zip', '======= Set 1 (Iris_test)', has_solutions=False, precision=4)
Expand Down

0 comments on commit 7b907be

Please sign in to comment.