Spaces:
Running
on
Zero
Running
on
Zero
Update scoring_calculation_system.py
Browse files
scoring_calculation_system.py
CHANGED
@@ -446,16 +446,7 @@ def calculate_compatibility_score(breed_info: dict, user_prefs: UserPreferences)
|
|
446 |
|
447 |
if user_prefs.size_preference != "no_preference":
|
448 |
if breed_info['Size'].lower() != user_prefs.size_preference.lower():
|
449 |
-
return
|
450 |
-
'space': 0,
|
451 |
-
'exercise': 0,
|
452 |
-
'grooming': 0,
|
453 |
-
'experience': 0,
|
454 |
-
'health': 0,
|
455 |
-
'noise': 0,
|
456 |
-
'overall': 0,
|
457 |
-
'adaptability_bonus': 0
|
458 |
-
}
|
459 |
|
460 |
def calculate_space_score(size: str, living_space: str, has_yard: bool, exercise_needs: str) -> float:
|
461 |
"""
|
@@ -1314,6 +1305,7 @@ def calculate_compatibility_score(breed_info: dict, user_prefs: UserPreferences)
|
|
1314 |
# 更新並返回完整的評分結果
|
1315 |
scores.update({
|
1316 |
'overall': final_score,
|
|
|
1317 |
'adaptability_bonus': adaptability_bonus
|
1318 |
})
|
1319 |
|
|
|
446 |
|
447 |
if user_prefs.size_preference != "no_preference":
|
448 |
if breed_info['Size'].lower() != user_prefs.size_preference.lower():
|
449 |
+
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
|
451 |
def calculate_space_score(size: str, living_space: str, has_yard: bool, exercise_needs: str) -> float:
|
452 |
"""
|
|
|
1305 |
# 更新並返回完整的評分結果
|
1306 |
scores.update({
|
1307 |
'overall': final_score,
|
1308 |
+
'size': breed_info['Size'],
|
1309 |
'adaptability_bonus': adaptability_bonus
|
1310 |
})
|
1311 |
|