hockey-blast-common-lib 0.1.40__tar.gz → 0.1.41__tar.gz

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.
Files changed (30) hide show
  1. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/PKG-INFO +1 -1
  2. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/aggregate_skater_stats.py +6 -0
  3. hockey_blast_common_lib-0.1.41/hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz +0 -0
  4. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/stats_models.py +3 -0
  5. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib.egg-info/PKG-INFO +1 -1
  6. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/setup.py +1 -1
  7. hockey_blast_common_lib-0.1.40/hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz +0 -0
  8. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/MANIFEST.in +0 -0
  9. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/README.md +0 -0
  10. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/__init__.py +0 -0
  11. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/aggregate_all_stats.py +0 -0
  12. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/aggregate_goalie_stats.py +0 -0
  13. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/aggregate_human_stats.py +0 -0
  14. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/aggregate_referee_stats.py +0 -0
  15. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/assign_skater_skill.py +0 -0
  16. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/db_connection.py +0 -0
  17. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/dump_sample_db.sh +0 -0
  18. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/models.py +0 -0
  19. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/options.py +0 -0
  20. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/restore_sample_db.sh +0 -0
  21. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/skills_in_divisions.py +0 -0
  22. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/skills_propagation.py +0 -0
  23. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/stats_utils.py +0 -0
  24. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/utils.py +0 -0
  25. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib/wsgi.py +0 -0
  26. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib.egg-info/SOURCES.txt +0 -0
  27. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib.egg-info/dependency_links.txt +0 -0
  28. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib.egg-info/requires.txt +0 -0
  29. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/hockey_blast_common_lib.egg-info/top_level.txt +0 -0
  30. {hockey_blast_common_lib-0.1.40 → hockey_blast_common_lib-0.1.41}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hockey-blast-common-lib
3
- Version: 0.1.40
3
+ Version: 0.1.41
4
4
  Summary: Common library for shared functionality and DB models
5
5
  Author: Pavel Kletskov
6
6
  Author-email: kletskov@gmail.com
@@ -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']
@@ -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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hockey-blast-common-lib
3
- Version: 0.1.40
3
+ Version: 0.1.41
4
4
  Summary: Common library for shared functionality and DB models
5
5
  Author: Pavel Kletskov
6
6
  Author-email: kletskov@gmail.com
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='hockey-blast-common-lib', # The name of your package
5
- version='0.1.40',
5
+ version='0.1.41',
6
6
  description='Common library for shared functionality and DB models',
7
7
  author='Pavel Kletskov',
8
8
  author_email='kletskov@gmail.com',