Spaces:
Sleeping
Sleeping
Update scoring_calculation_system.py
Browse files
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 |
-
|
| 1999 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|