Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/diffmage/evaluation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ def get_quality_level(score: float) -> str:
Returns one of:
- Excellent (4.5-5.0)
- Good (3.5-4.4)
- Average (2.6-3.5)
- Poor (1.6-2.5)
- Very Poor (0.0-1.5)
- Average (2.5-3.4)
- Poor (1.5-2.4)
- Very Poor (1.0-1.4)
"""
if score >= ScoreThresholds.EXCELLENT:
if score >= ScoreThresholds.EXCELLENT: # 4.5-5.0
return "Excellent"
elif score > ScoreThresholds.GOOD:
elif score >= ScoreThresholds.GOOD: # 3.5-4.4
return "Good"
elif score > ScoreThresholds.AVERAGE:
elif score >= ScoreThresholds.AVERAGE: # 2.5-3.4
return "Average"
elif score > ScoreThresholds.POOR:
elif score >= ScoreThresholds.POOR: # 1.5-2.4
return "Poor"
else:
else: # 1.0-1.4
return "Very Poor"

@staticmethod
Expand Down
4 changes: 2 additions & 2 deletions tests/evaluation/test_evaluation_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ def test_quality_distribution_calculations(self, report):

assert stats["quality_distribution"]["Excellent"] == 0
assert stats["quality_distribution"]["Good"] == 1
assert stats["quality_distribution"]["Average"] == 0
assert stats["quality_distribution"]["Poor"] == 1
assert stats["quality_distribution"]["Average"] == 1
assert stats["quality_distribution"]["Poor"] == 0

def test_model_usage_calculations(self, report):
"""Test model usage calculations"""
Expand Down