Skip to content

Faster relative score calculation - #34

Merged
Yuki-Imajuku merged 1 commit into
mainfrom
feat/faster-relative-score-calculation
May 29, 2026
Merged

Faster relative score calculation#34
Yuki-Imajuku merged 1 commit into
mainfrom
feat/faster-relative-score-calculation

Conversation

@Yuki-Imajuku

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 29, 2026 06:57
@Yuki-Imajuku
Yuki-Imajuku merged commit 254140a into main May 29, 2026
10 of 11 checks passed
@Yuki-Imajuku
Yuki-Imajuku deleted the feat/faster-relative-score-calculation branch May 29, 2026 06:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors RelativeResults.recalculate_relative_score for better performance by avoiding deepcopy, eliminating the per-user sort, and precomputing rank-based scores once per distinct absolute score via Counter. Also adds a test for the existing MIN-with-zero-score error path.

Changes:

  • Replace deepcopy(existing_scores) + append with list-spread to build case_scores.
  • Compute best_score for MAX/MIN with a single pass instead of sorting; compute RANK scores once per unique value via Counter and reuse for ties.
  • Add test_calculate_min_relative_score_zero_new_score covering the MIN zero-score RuntimeError.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/ale_bench/data.py Performance refactor of recalculate_relative_score; switches sort-based scoring to single-pass min/max and Counter-based rank computation.
tests/test_data.py Adds a test for MIN relative-score-type rejecting a new score of 0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants