File size: 494 Bytes
55f57c9
bed19e6
 
55f57c9
 
bed19e6
55f57c9
bed19e6
55f57c9
bed19e6
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""
Scoring utilities for PRIVAL.
Aggregates individual dimension scores into a total score.
"""

def aggregate_scores(results: dict, config: dict) -> float:
    """
    Compute the overall score as the simple average of available numeric scores.
    """
    scores = []
    for dim, res in results.items():
        score = res.get('score')
        if isinstance(score, (int, float)):
            scores.append(score)
    if not scores:
        return None
    return sum(scores) / len(scores)