Skip to content

refactor: deduplicate calculate_final_earned_score between PullRequest and ScoredMirrorPR - #951

Merged
anderdc merged 1 commit into
entrius:testfrom
dataCenter430:refactor/dedupe-scoring-and-weights-loader
May 6, 2026
Merged

refactor: deduplicate calculate_final_earned_score between PullRequest and ScoredMirrorPR#951
anderdc merged 1 commit into
entrius:testfrom
dataCenter430:refactor/dedupe-scoring-and-weights-loader

Conversation

@dataCenter430

Copy link
Copy Markdown
Contributor

Summary

Closes #950

Extract _apply_score_multipliers(base_score, multipliers, pr_label) into classes.py so PullRequest and ScoredMirrorPR share one implementation of the multiplier computation and log lines.

Changes

  • Add _apply_score_multipliers as a module-level function in classes.py
  • Update PullRequest.calculate_final_earned_score to delegate to it
  • Update ScoredMirrorPR.calculate_final_earned_score to import and delegate to it
  • Drop now-unused from math import prod and import bittensor as bt from scored_pr.py

Behaviour

No behaviour change — multiplier keys, order, earned-score assignment, and log output are identical to before.

Test plan

  • Existing scoring tests pass unchanged
  • Log output format is identical to before

@xiao-xiao-mao xiao-xiao-mao Bot added the refactor Code restructuring without behavior change label May 3, 2026
@dataCenter430
dataCenter430 force-pushed the refactor/dedupe-scoring-and-weights-loader branch 2 times, most recently from 88a91f0 to 2fc83d3 Compare May 4, 2026 16:40
@dataCenter430
dataCenter430 force-pushed the refactor/dedupe-scoring-and-weights-loader branch 8 times, most recently from d969ec9 to 6e2f951 Compare May 6, 2026 21:12
@dataCenter430
dataCenter430 force-pushed the refactor/dedupe-scoring-and-weights-loader branch from 6e2f951 to b41013a Compare May 6, 2026 21:55
@anderdc
anderdc merged commit 9b70499 into entrius:test May 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor duplicated PR score multiplier calculation

2 participants