Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -785,12 +785,12 @@ def compute_domain_scores(merged_data, df_analysis, patterns):
|
|
| 785 |
row_map = {row["variable"]: row for _, row in df_analysis.iterrows()}
|
| 786 |
|
| 787 |
def var_points(var_name, weight=1.0):
|
| 788 |
-
|
| 789 |
-
|
| 790 |
-
|
| 791 |
-
|
| 792 |
-
|
| 793 |
-
|
| 794 |
|
| 795 |
def pattern_points(category):
|
| 796 |
total = 0
|
|
|
|
| 785 |
row_map = {row["variable"]: row for _, row in df_analysis.iterrows()}
|
| 786 |
|
| 787 |
def var_points(var_name, weight=1.0):
|
| 788 |
+
row = row_map.get(var_name)
|
| 789 |
+
if row is None:
|
| 790 |
+
return 0.0
|
| 791 |
+
base = priority_to_points(row["priority"]) * 10
|
| 792 |
+
bonus = row["deviation_score"] * 20
|
| 793 |
+
return (base + bonus) * weight
|
| 794 |
|
| 795 |
def pattern_points(category):
|
| 796 |
total = 0
|