Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
hostname: postgres
restart: always
env_file: .env
command: ["postgres", "-c", "max_connections=500"]
healthcheck:
test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB
interval: 5s
Expand Down
6 changes: 3 additions & 3 deletions src/apps/core/services/affinity_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
class AffinityCalculator:
MAX_AFFINITY = 100.0
MIN_AFFINITY = 0.0
PARTIAL_INDIFFERENCE_SCORE = 75.0
PARTIAL_INDIFFERENCE_SCORE = 51.0
MAX_POSSIBLE_GAP = 200.0

COND_MATCH_BONUS = 5.0
COND_INDIFFERENT_BONUS = 2.5
COND_MISMATCH_PENALTY = 5.0

MAX_COND_POSITIVE_CAP = 20.0
MAX_COND_NEGATIVE_CAP = 25.0
MAX_COND_POSITIVE_CAP = 15.0
MAX_COND_NEGATIVE_CAP = 20.0

def __init__(
self, data_a: Dict[str, CalculationItem], data_b: Dict[str, CalculationItem]
Expand Down
1 change: 1 addition & 0 deletions src/backend/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"PASSWORD": env("POSTGRES_PASSWORD", default=""),
"HOST": env("POSTGRES_HOST", default="postgres"),
"PORT": env("POSTGRES_PORT", default=""),
"CONN_MAX_AGE": env.int("CONN_MAX_AGE", default=1000),
"DISABLE_SERVER_SIDE_CURSORS": True,
"TEST": {
"NAME": "testing_database",
Expand Down
6 changes: 3 additions & 3 deletions src/tests/apps/core/services/test_affinity_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_one_sided_indifference(self):
self._get_data(self.user_a), self._get_data(self.user_b)
)
result = calc.calculate_detailed()
self.assertEqual(result["total"], 75.0)
self.assertEqual(result["total"], 51.0)

def test_gap_logic_min2_greater_max1(self):
UserAxisAnswerFactory(
Expand Down Expand Up @@ -236,8 +236,8 @@ def test_conditioner_scoring_mechanics_and_missing_keys(self):
base_affinity = complexity_res["base_affinity"]
modifier = complexity_res["conditioner_modifier"]

self.assertEqual(base_affinity, 75.0)
self.assertEqual(base_affinity, 51.0)

expected_modifier = 5.0 - 5.0 + 2.5
self.assertEqual(modifier, expected_modifier)
self.assertEqual(result["total"], 75.0 + expected_modifier)
self.assertEqual(result["total"], 51.0 + expected_modifier)
Loading