def compute_away_team_aggregation(m1, m2) -> Counter: aggregation1 = Counter( team_goals_aggregator.get_team_goals_from_away_team(m1)) aggregation2 = Counter( team_goals_aggregator.get_team_goals_from_away_team(m2)) return combine_aggregations([aggregation1, aggregation2])
def test_halftime_fulltime_double_chance(): match1.outcome1stHalf = 'A' match1.finalOutcome = 'A' match2.outcome1stHalf = 'D' match2.finalOutcome = 'H' match3.outcome1stHalf = 'H' match3.finalOutcome = 'D' match4.outcome1stHalf = 'D' match4.finalOutcome = 'A' aggregation1 = Counter( outcome_aggregator.get_double_chance_1st_half_2nd_half(match1)) aggregation2 = Counter( outcome_aggregator.get_double_chance_1st_half_2nd_half(match2)) aggregation3 = Counter( outcome_aggregator.get_double_chance_1st_half_2nd_half(match3)) aggregation4 = Counter( outcome_aggregator.get_double_chance_1st_half_2nd_half(match4)) final_aggregation = combine_aggregations( [aggregation1, aggregation2, aggregation3, aggregation4]) assert final_aggregation['12-12'] == 1 assert final_aggregation['12-1X'] == 1 assert final_aggregation['12-X2'] == 2
def test_halftime_fulltime_outcome(): match1.outcome1stHalf = 'A' match1.finalOutcome = 'A' match2.outcome1stHalf = 'D' match2.finalOutcome = 'H' match3.outcome1stHalf = 'H' match3.finalOutcome = 'D' match4.outcome1stHalf = 'D' match4.finalOutcome = 'A' aggregation1 = Counter(outcome_aggregator.get_1st_half_2nd_half(match1)) aggregation2 = Counter(outcome_aggregator.get_1st_half_2nd_half(match2)) aggregation3 = Counter(outcome_aggregator.get_1st_half_2nd_half(match3)) aggregation4 = Counter(outcome_aggregator.get_1st_half_2nd_half(match4)) final_aggregation = combine_aggregations( [aggregation1, aggregation2, aggregation3, aggregation4]) assert final_aggregation['1-1'] == 0 assert final_aggregation['1-X'] == 1 assert final_aggregation['1-2'] == 0 assert final_aggregation['X-1'] == 1 assert final_aggregation['X-X'] == 0 assert final_aggregation['X-2'] == 1 assert final_aggregation['2-1'] == 0 assert final_aggregation['2-X'] == 0 assert final_aggregation['2-2'] == 1
def test_second_halftime_outcome(): match1.outcome2ndHalf = 'H' match2.outcome2ndHalf = 'H' match3.outcome2ndHalf = 'A' match4.outcome2ndHalf = 'D' aggregation1 = Counter(outcome_aggregator.get_2nd_half_outcome(match1)) aggregation2 = Counter(outcome_aggregator.get_2nd_half_outcome(match2)) aggregation3 = Counter(outcome_aggregator.get_2nd_half_outcome(match3)) aggregation4 = Counter(outcome_aggregator.get_2nd_half_outcome(match4)) final_aggregation = combine_aggregations( [aggregation1, aggregation2, aggregation3, aggregation4]) assert final_aggregation['1'] == 2 assert final_aggregation['X'] == 1 assert final_aggregation['2'] == 1
def test_fulltime_outcome(): match1.finalOutcome = 'H' match2.finalOutcome = 'H' match3.finalOutcome = 'A' match4.finalOutcome = 'D' aggregation1 = Counter(outcome_aggregator.get_fulltime_outcome(match1)) aggregation2 = Counter(outcome_aggregator.get_fulltime_outcome(match2)) aggregation3 = Counter(outcome_aggregator.get_fulltime_outcome(match3)) aggregation4 = Counter(outcome_aggregator.get_fulltime_outcome(match4)) final_aggregation = combine_aggregations( [aggregation1, aggregation2, aggregation3, aggregation4]) assert final_aggregation['1'] == 2 assert final_aggregation['X'] == 1 assert final_aggregation['2'] == 1
def compute_both_teams_aggregation(m1, m2) -> Counter: aggregation1 = Counter(team_goals_aggregator.get_both_team_goals(m1)) aggregation2 = Counter(team_goals_aggregator.get_both_team_goals(m2)) return combine_aggregations([aggregation1, aggregation2])
def compute_total_goals_2ndhalf_aggregation(match1, match2) -> Counter: aggregation1 = Counter(goals_aggregator.get_2nd_half_goals(match1)) aggregation2 = Counter(goals_aggregator.get_2nd_half_goals(match2)) return combine_aggregations([aggregation1, aggregation2])
def compute_halftime_more_goals(m1, m2, m3) -> Counter: aggregation1 = Counter(mixed_games_aggregator.get_halftime_more_goals(m1)) aggregation2 = Counter(mixed_games_aggregator.get_halftime_more_goals(m2)) aggregation3 = Counter(mixed_games_aggregator.get_halftime_more_goals(m3)) return combine_aggregations([aggregation1, aggregation2, aggregation3])
def compute_exact_result(m1, m2, m3) -> Counter: aggregation1 = Counter(mixed_games_aggregator.get_exact_result(m1)) aggregation2 = Counter(mixed_games_aggregator.get_exact_result(m2)) aggregation3 = Counter(mixed_games_aggregator.get_exact_result(m3)) return combine_aggregations([aggregation1, aggregation2, aggregation3])
def compute_aggregation(m1, m2, m3) -> Counter: aggregation1 = Counter(mixed_games_aggregator.aggregate_mixed(m1)) aggregation2 = Counter(mixed_games_aggregator.aggregate_mixed(m2)) aggregation3 = Counter(mixed_games_aggregator.aggregate_mixed(m3)) return combine_aggregations([aggregation1, aggregation2, aggregation3])