-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
109 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0 | ||
5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import logging | ||
from typing import Dict | ||
|
||
import numpy as np | ||
import pandas as pd | ||
from carball.analysis.constants.field_constants import FieldConstants | ||
|
||
from carball.analysis.stats.utils.pandas_utils import sum_deltas_by_truthy_data | ||
from ....analysis.stats.stats import BaseStat | ||
from ....generated.api import game_pb2 | ||
from ....generated.api.player_pb2 import Player | ||
from ....generated.api.stats.player_stats_pb2 import PlayerStats | ||
from ....json_parser.actor.boost import BOOST_PER_SECOND | ||
from ....json_parser.game import Game | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class DemoStat(BaseStat): | ||
def calculate_player_stat(self, player_stat_map: Dict[str, PlayerStats], game: Game, proto_game: game_pb2.Game, | ||
player_map: Dict[str, Player], data_frame: pd.DataFrame): | ||
player_demo_counts = {} | ||
player_got_demoed_counts = {} | ||
for demo in game.demos: | ||
attacker = demo['attacker'].online_id | ||
victim = demo['victim'].online_id | ||
if attacker not in player_demo_counts: | ||
player_demo_counts[attacker] = 1 | ||
else: | ||
player_demo_counts[attacker] += 1 | ||
if victim not in player_got_demoed_counts: | ||
player_got_demoed_counts[victim] = 1 | ||
else: | ||
player_got_demoed_counts[victim] += 1 | ||
for player in player_demo_counts: | ||
player_stat_map[player].demo_stats.num_demos_inflicted = player_demo_counts[player] | ||
for player in player_got_demoed_counts: | ||
player_stat_map[player].demo_stats.num_demos_taken = player_got_demoed_counts[player] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ numpy==1.18.2 | |
protobuf==3.6.1 | ||
pandas==1.0.3 | ||
xlrd==1.1.0 | ||
boxcars-py==0.1.3 | ||
boxcars-py==0.1.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4305e0e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Carball Benchmarks short_sample
carball/tests/benchmarking/benchmarking.py::test_short_sample
0.9724857256532954
iter/sec (stddev: 0.014489486537814192
)0.9068065034710597
iter/sec (stddev: 0.00924296428449896
)0.93
This comment was automatically generated by workflow using github-action-benchmark.
4305e0e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Carball Benchmarks short_dropshot
carball/tests/benchmarking/benchmarking.py::test_short_dropshot
0.6707021716982366
iter/sec (stddev: 0.01816230047862237
)0.6936401698877517
iter/sec (stddev: 0.0052686922532796596
)1.03
This comment was automatically generated by workflow using github-action-benchmark.
4305e0e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Carball Benchmarks intensive_oce_rlcs
carball/tests/benchmarking/benchmarking.py::test_intensive_oce_rlcs
0.0484132228330891
iter/sec (stddev: 0.3029039001351704
)0.06058107089228804
iter/sec (stddev: 0.18968435257771193
)1.25
This comment was automatically generated by workflow using github-action-benchmark.