DawnC commited on
Commit
d776e91
โ€ข
1 Parent(s): 1fd2c2a

Update scoring_calculation_system.py

Browse files
Files changed (1) hide show
  1. scoring_calculation_system.py +4 -0
scoring_calculation_system.py CHANGED
@@ -1661,6 +1661,10 @@ def calculate_compatibility_score(breed_info: dict, user_prefs: UserPreferences)
1661
  # ็ขบไฟๆœ€็ต‚ๅˆ†ๆ•ธๅœจๅˆ็†็ฏ„ๅœๅ…ง
1662
  return max(0.15, min(1.0, final_score))
1663
 
 
 
 
 
1664
 
1665
  def calculate_environmental_fit(breed_info: dict, user_prefs: UserPreferences) -> float:
1666
  """่จˆ็ฎ—ๅ“็จฎ่ˆ‡็’ฐๅขƒ็š„้ฉๆ‡‰ๆ€งๅŠ ๆˆ"""
 
1661
  # ็ขบไฟๆœ€็ต‚ๅˆ†ๆ•ธๅœจๅˆ็†็ฏ„ๅœๅ…ง
1662
  return max(0.15, min(1.0, final_score))
1663
 
1664
+ except Exception as e:
1665
+ print(f"Error calculating compatibility score: {str(e)}")
1666
+ return 60.0 # ่ฟ”ๅ›žๆœ€ไฝŽๅˆ†ๆ•ธไฝœ็‚บ้ป˜่ชๅ€ผ
1667
+
1668
 
1669
  def calculate_environmental_fit(breed_info: dict, user_prefs: UserPreferences) -> float:
1670
  """่จˆ็ฎ—ๅ“็จฎ่ˆ‡็’ฐๅขƒ็š„้ฉๆ‡‰ๆ€งๅŠ ๆˆ"""