hockey-blast-common-lib 0.1.40__py3-none-any.whl → 0.1.41__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hockey_blast_common_lib/aggregate_skater_stats.py +6 -0
- hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz +0 -0
- hockey_blast_common_lib/stats_models.py +3 -0
- {hockey_blast_common_lib-0.1.40.dist-info → hockey_blast_common_lib-0.1.41.dist-info}/METADATA +1 -1
- {hockey_blast_common_lib-0.1.40.dist-info → hockey_blast_common_lib-0.1.41.dist-info}/RECORD +7 -7
- {hockey_blast_common_lib-0.1.40.dist-info → hockey_blast_common_lib-0.1.41.dist-info}/WHEEL +0 -0
- {hockey_blast_common_lib-0.1.40.dist-info → hockey_blast_common_lib-0.1.41.dist-info}/top_level.txt +0 -0
@@ -135,6 +135,7 @@ def aggregate_skater_stats(session, aggregation_type, aggregation_id, names_to_f
|
|
135
135
|
'points_per_game': 0.0,
|
136
136
|
'assists_per_game': 0.0,
|
137
137
|
'penalties_per_game': 0.0,
|
138
|
+
'gm_penalties_per_game': 0.0, # Initialize GM penalties per game
|
138
139
|
'game_ids': [],
|
139
140
|
'first_game_id': None,
|
140
141
|
'last_game_id': None
|
@@ -176,6 +177,7 @@ def aggregate_skater_stats(session, aggregation_type, aggregation_id, names_to_f
|
|
176
177
|
stat['points_per_game'] = stat['points'] / stat['games_played']
|
177
178
|
stat['assists_per_game'] = stat['assists'] / stat['games_played']
|
178
179
|
stat['penalties_per_game'] = stat['penalties'] / stat['games_played']
|
180
|
+
stat['gm_penalties_per_game'] = stat['gm_penalties'] / stat['games_played'] # Calculate GM penalties per game
|
179
181
|
|
180
182
|
# Ensure all keys have valid human_id values
|
181
183
|
stats_dict = {key: value for key, value in stats_dict.items() if key[1] is not None}
|
@@ -208,6 +210,7 @@ def aggregate_skater_stats(session, aggregation_type, aggregation_id, names_to_f
|
|
208
210
|
assign_ranks(stats_dict, 'points_per_game')
|
209
211
|
assign_ranks(stats_dict, 'assists_per_game')
|
210
212
|
assign_ranks(stats_dict, 'penalties_per_game')
|
213
|
+
assign_ranks(stats_dict, 'gm_penalties_per_game') # Assign ranks for GM penalties per game
|
211
214
|
|
212
215
|
# Debug output for specific human
|
213
216
|
if debug_human_id:
|
@@ -229,6 +232,7 @@ def aggregate_skater_stats(session, aggregation_type, aggregation_id, names_to_f
|
|
229
232
|
points_per_game = (stat['goals'] + stat['assists']) / stat['games_played'] if stat['games_played'] > 0 else 0.0
|
230
233
|
assists_per_game = stat['assists'] / stat['games_played'] if stat['games_played'] > 0 else 0.0
|
231
234
|
penalties_per_game = stat['penalties'] / stat['games_played'] if stat['games_played'] > 0 else 0.0
|
235
|
+
gm_penalties_per_game = stat['gm_penalties'] / stat['games_played'] if stat['games_played'] > 0 else 0.0 # Calculate GM penalties per game
|
232
236
|
skater_stat = StatsModel(
|
233
237
|
aggregation_id=aggregation_id,
|
234
238
|
human_id=human_id,
|
@@ -242,6 +246,7 @@ def aggregate_skater_stats(session, aggregation_type, aggregation_id, names_to_f
|
|
242
246
|
points_per_game=points_per_game,
|
243
247
|
assists_per_game=assists_per_game,
|
244
248
|
penalties_per_game=penalties_per_game,
|
249
|
+
gm_penalties_per_game=gm_penalties_per_game, # Include GM penalties per game
|
245
250
|
games_played_rank=stat['games_played_rank'],
|
246
251
|
goals_rank=stat['goals_rank'],
|
247
252
|
assists_rank=stat['assists_rank'],
|
@@ -252,6 +257,7 @@ def aggregate_skater_stats(session, aggregation_type, aggregation_id, names_to_f
|
|
252
257
|
points_per_game_rank=stat['points_per_game_rank'],
|
253
258
|
assists_per_game_rank=stat['assists_per_game_rank'],
|
254
259
|
penalties_per_game_rank=stat['penalties_per_game_rank'],
|
260
|
+
gm_penalties_per_game_rank=stat['gm_penalties_per_game_rank'], # Include GM penalties per game rank
|
255
261
|
total_in_rank=total_in_rank,
|
256
262
|
first_game_id=stat['first_game_id'],
|
257
263
|
last_game_id=stat['last_game_id']
|
Binary file
|
@@ -72,6 +72,8 @@ class BaseStatsSkater(db.Model):
|
|
72
72
|
assists_per_game_rank = db.Column(db.Integer, default=0)
|
73
73
|
penalties_per_game = db.Column(db.Float, default=0.0)
|
74
74
|
penalties_per_game_rank = db.Column(db.Integer, default=0)
|
75
|
+
gm_penalties_per_game = db.Column(db.Float, default=0.0)
|
76
|
+
gm_penalties_per_game_rank = db.Column(db.Integer, default=0)
|
75
77
|
total_in_rank = db.Column(db.Integer, default=0)
|
76
78
|
first_game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
|
77
79
|
last_game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
|
@@ -84,6 +86,7 @@ class BaseStatsSkater(db.Model):
|
|
84
86
|
db.Index(f'idx_{cls.aggregation_type}_points_per_game3', cls.get_aggregation_column(), 'points_per_game'),
|
85
87
|
db.Index(f'idx_{cls.aggregation_type}_assists_per_game3', cls.get_aggregation_column(), 'assists_per_game'),
|
86
88
|
db.Index(f'idx_{cls.aggregation_type}_penalties_per_game3', cls.get_aggregation_column(), 'penalties_per_game'),
|
89
|
+
db.Index(f'idx_{cls.aggregation_type}_gm_penalties_per_game3', cls.get_aggregation_column(), 'gm_penalties_per_game'),
|
87
90
|
db.Index(f'idx_{cls.aggregation_type}_games_played3', cls.get_aggregation_column(), 'games_played')
|
88
91
|
)
|
89
92
|
|
{hockey_blast_common_lib-0.1.40.dist-info → hockey_blast_common_lib-0.1.41.dist-info}/RECORD
RENAMED
@@ -3,21 +3,21 @@ hockey_blast_common_lib/aggregate_all_stats.py,sha256=MUjT23mdOMfCTx-kRSY-LGrLHZ
|
|
3
3
|
hockey_blast_common_lib/aggregate_goalie_stats.py,sha256=FcYL40NP0-sPY7UI7F8Ny_RaPKz3mfkmhQnPVbeRtOc,12178
|
4
4
|
hockey_blast_common_lib/aggregate_human_stats.py,sha256=6cDoiJ0xZ3aQ4wjEAP_Jgu2aNEicnuU-a22BncSFtRo,23920
|
5
5
|
hockey_blast_common_lib/aggregate_referee_stats.py,sha256=FszWLTygddDQNcUgbmevQ-eGPrW8Y0nXpRvUluPRKnU,11920
|
6
|
-
hockey_blast_common_lib/aggregate_skater_stats.py,sha256=
|
6
|
+
hockey_blast_common_lib/aggregate_skater_stats.py,sha256=FBc6enJNnFXYg7mVPiXssleTA1vZRAXCTFUa-3eOGdo,17199
|
7
7
|
hockey_blast_common_lib/assign_skater_skill.py,sha256=p-0fbodGpM8BCjKHDpxNb7BH2FcIlBsJwON844KNrUY,1817
|
8
8
|
hockey_blast_common_lib/db_connection.py,sha256=HvPxDvOj7j5H85RfslGvHVNevfg7mKCd0syJ6NX21mU,1890
|
9
9
|
hockey_blast_common_lib/dump_sample_db.sh,sha256=MHPA-Ciod7wsvAlMbRtXFiyajgnEqU1xR59sJQ9UWR0,738
|
10
|
-
hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz,sha256=
|
10
|
+
hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz,sha256=TWtisyYlIRkQCKfyXRS_iYKq_8qDb6KHQEg020FkKrM,51
|
11
11
|
hockey_blast_common_lib/models.py,sha256=xne38KwdBDcWvzdLyU6toozqkuatB9wiQhyiQ4xvAgU,16413
|
12
12
|
hockey_blast_common_lib/options.py,sha256=6na8fo-5A2RBPpd_h-7dsqetOLSLoNEJg1QMYgl4jNs,792
|
13
13
|
hockey_blast_common_lib/restore_sample_db.sh,sha256=u2zKazC6vNMULkpYzI64nlneCWaGUtDHPBAU-gWgRbw,1861
|
14
14
|
hockey_blast_common_lib/skills_in_divisions.py,sha256=m-UEwMwn1KM7wOYvDstgsOEeH57M9V6yrkBoghzGYKE,7005
|
15
15
|
hockey_blast_common_lib/skills_propagation.py,sha256=x6yy7fJ6IX3YiHqiP_v7-p_S2Expb8JJ-mWuajEFBdY,16388
|
16
|
-
hockey_blast_common_lib/stats_models.py,sha256=
|
16
|
+
hockey_blast_common_lib/stats_models.py,sha256=NWigeIowIJU6o1Sk1cP08kEy4t594LZpecKUnl-O6as,25552
|
17
17
|
hockey_blast_common_lib/stats_utils.py,sha256=DXsPO4jw8XsdRUN46TGF_IiBAfz3GCIVBswCGp5ELDk,284
|
18
18
|
hockey_blast_common_lib/utils.py,sha256=Sy5Pk40Tk3gsMrhMsUMlBD7i7jiVZmWLUBc94qI3zOA,5235
|
19
19
|
hockey_blast_common_lib/wsgi.py,sha256=7LGUzioigviJp-EUhSEaQcd4jBae0mxbkyBscQfZhlc,730
|
20
|
-
hockey_blast_common_lib-0.1.
|
21
|
-
hockey_blast_common_lib-0.1.
|
22
|
-
hockey_blast_common_lib-0.1.
|
23
|
-
hockey_blast_common_lib-0.1.
|
20
|
+
hockey_blast_common_lib-0.1.41.dist-info/METADATA,sha256=r0-HHK9qO6fisdLkPOc4pDRMEfobEu4D4sstUM1-gsw,318
|
21
|
+
hockey_blast_common_lib-0.1.41.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
22
|
+
hockey_blast_common_lib-0.1.41.dist-info/top_level.txt,sha256=wIR4LIkE40npoA2QlOdfCYlgFeGbsHR8Z6r0h46Vtgc,24
|
23
|
+
hockey_blast_common_lib-0.1.41.dist-info/RECORD,,
|
File without changes
|
{hockey_blast_common_lib-0.1.40.dist-info → hockey_blast_common_lib-0.1.41.dist-info}/top_level.txt
RENAMED
File without changes
|