DawnC commited on
Commit
166f736
โ€ข
1 Parent(s): 2660823

Update scoring_calculation_system.py

Browse files
Files changed (1) hide show
  1. scoring_calculation_system.py +21 -2
scoring_calculation_system.py CHANGED
@@ -1995,8 +1995,12 @@ def calculate_breed_compatibility_score(scores: dict, user_prefs: UserPreference
1995
 
1996
  # ็ฉบ้–“ๆฌŠ้‡่ชฟๆ•ด้‚่ผฏไฟๆŒไธ่ฎŠ
1997
  if extremities['space'][0] == 'highly_restricted':
1998
- adjustments['space'] = 2.5
1999
- adjustments['noise'] = 2.0
 
 
 
 
2000
  elif extremities['space'][0] == 'restricted':
2001
  adjustments['space'] = 1.8
2002
  adjustments['noise'] = 1.5
@@ -2005,6 +2009,12 @@ def calculate_breed_compatibility_score(scores: dict, user_prefs: UserPreference
2005
  adjustments['exercise'] = 1.4
2006
 
2007
  # ๆ”น้€ฒ้‹ๅ‹•้œ€ๆฑ‚ๆฌŠ้‡่ชฟๆ•ด
 
 
 
 
 
 
2008
  if extremities['exercise'][0] in ['extremely_low', 'extremely_high']:
2009
  base_adjustment = 2.5
2010
  if extremities['exercise'][0] == 'extremely_high':
@@ -2047,6 +2057,15 @@ def calculate_breed_compatibility_score(scores: dict, user_prefs: UserPreference
2047
  for key in ['grooming', 'health', 'noise']:
2048
  if key not in adjustments:
2049
  adjustments[key] = 1.2
 
 
 
 
 
 
 
 
 
2050
 
2051
  adjust_for_combinations()
2052
  return adjustments
 
1995
 
1996
  # ็ฉบ้–“ๆฌŠ้‡่ชฟๆ•ด้‚่ผฏไฟๆŒไธ่ฎŠ
1997
  if extremities['space'][0] == 'highly_restricted':
1998
+ if extremities['exercise'][0] in ['high', 'extremely_high']:
1999
+ adjustments['space'] = 1.8 # ้™ไฝŽ็ฉบ้–“้™ๅˆถ็š„ๆฌŠ้‡
2000
+ adjustments['exercise'] = 2.5 # ๆ้ซ˜้‹ๅ‹•่ƒฝๅŠ›็š„ๆฌŠ้‡
2001
+ else:
2002
+ adjustments['space'] = 2.5
2003
+ adjustments['noise'] = 2.0
2004
  elif extremities['space'][0] == 'restricted':
2005
  adjustments['space'] = 1.8
2006
  adjustments['noise'] = 1.5
 
2009
  adjustments['exercise'] = 1.4
2010
 
2011
  # ๆ”น้€ฒ้‹ๅ‹•้œ€ๆฑ‚ๆฌŠ้‡่ชฟๆ•ด
2012
+ if extremities['exercise'][0] in ['high', 'extremely_high']:
2013
+ # ๆ้ซ˜้‹ๅ‹•้‡้ซ˜ๆ™‚็š„ๅŸบ็คŽๅˆ†ๆ•ธ
2014
+ base_exercise_adjustment = 2.2
2015
+ if user_prefs.living_space == 'apartment':
2016
+ base_exercise_adjustment = 2.5 # ็‰นๅˆฅ็Žๅ‹ตๅ…ฌๅฏ“ไฝๆˆถ็š„้ซ˜้‹ๅ‹•้‡
2017
+ adjustments['exercise'] = base_exercise_adjustment
2018
  if extremities['exercise'][0] in ['extremely_low', 'extremely_high']:
2019
  base_adjustment = 2.5
2020
  if extremities['exercise'][0] == 'extremely_high':
 
2057
  for key in ['grooming', 'health', 'noise']:
2058
  if key not in adjustments:
2059
  adjustments[key] = 1.2
2060
+
2061
+ def ensure_minimum_score(score):
2062
+ if all([
2063
+ extremities['exercise'][0] in ['high', 'extremely_high'],
2064
+ breed_matches_exercise_needs(), # ๆชขๆŸฅๅ“็จฎๆ˜ฏๅฆ้ฉๅˆ่ฉฒ้‹ๅ‹•้‡
2065
+ score < 0.85
2066
+ ]):
2067
+ return 0.85
2068
+ return score
2069
 
2070
  adjust_for_combinations()
2071
  return adjustments