nfelodcm 0.1.5__py3-none-any.whl → 0.1.7__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.
@@ -15,8 +15,9 @@ assignments = {
15
15
  'desc_based_plays' : {
16
16
  'func' : desc_based_plays,
17
17
  'new_columns' : [
18
- 'qb_dropback_all', 'rush_attempt_all',
19
- 'play_call'
18
+ ('qb_dropback_all', 'float32'),
19
+ ('rush_attempt_all', 'float32'),
20
+ ('play_call', 'str'),
20
21
  ]
21
22
  }
22
23
  }
@@ -1,5 +1,7 @@
1
1
  import pandas as pd
2
2
  import numpy
3
+ import pathlib
4
+ import json
3
5
 
4
6
  from .Engine import DCMTable
5
7
  import nfelodcm.nfelodcm.Utilities as utils
@@ -46,4 +48,23 @@ def get_map(url):
46
48
  print('"{0}": "{1}",'.format(
47
49
  col, dtype
48
50
  ))
49
-
51
+
52
+ def get_season_state(state_type='last_full_week'):
53
+ '''
54
+ Returns the season and week of the specified state type:
55
+ 'last_full_week' (default): the last week in which no games are still unplayed
56
+ 'last_partual_week': the last week where any game has been played
57
+ 'next_week': the first week with no games played
58
+ '''
59
+ ## open global variables json ##
60
+ global_variables = None
61
+ with open('{0}/global_variables.json'.format(pathlib.Path(__file__).parent.resolve()), 'r') as fp:
62
+ ## load config ##
63
+ global_variables = json.load(fp)
64
+ ## check input ##
65
+ if state_type not in list(global_variables['season_states'].keys()):
66
+ raise Exception('UTILITY ERROR: {0} is not an available state_type. Available types: {1}'.format(
67
+ state_type, '\n '.join(list(global_variables['season_states'].keys()))
68
+ ))
69
+ ## if state valid, return ##
70
+ return global_variables[state_type]['season'], global_variables[state_type]['week']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nfelodcm
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: Python package for loading and caching CSVs hosted on github into pandas dataframes
5
5
  Author-email: Robert Greer <nfl@robbygreer.com>
6
6
  Maintainer-email: Robert Greer <nfl@robbygreer.com>
@@ -1,9 +1,9 @@
1
1
  nfelodcm/__init__.py,sha256=T4OUcbJYVwMLzKSrm7CRT84jeqlvQeVWhfV2RCKlYM0,112
2
- nfelodcm/nfelodcm/nfelodcm.py,sha256=Q96CBvdmyx-c-AQ67szBHoG38yxXlsjZq-liomu6oro,1128
2
+ nfelodcm/nfelodcm/nfelodcm.py,sha256=97BA_U3RikyzxS5Mbewrgb4HYYTa1YQ4S47l5wN_tA0,2145
3
3
  nfelodcm/nfelodcm/Engine/DCMTable.py,sha256=9_x82HKPWOwkIqQF4qZvUCLg8n6IUQfrtLlaU4bPIxM,2646
4
4
  nfelodcm/nfelodcm/Engine/__init__.py,sha256=vEEWcIBE4KLHoBCT1s2AIeSZxMfv1bcAqUNAJzSMSMo,31
5
5
  nfelodcm/nfelodcm/Engine/Assignments/__init__.py,sha256=IPKxTBbO3b0xaO922zkwif0FFd8Xqe3ZvCIFjhYg1oE,80
6
- nfelodcm/nfelodcm/Engine/Assignments/assignment.py,sha256=EilesQmSlewgmceQBeIxguw0lTffRXsTpUgprSbULpk,1144
6
+ nfelodcm/nfelodcm/Engine/Assignments/assignment.py,sha256=Mol-Sc5buLfJ-h9ItzeUxXxPAzvj0rvQbUJhl3_lgL4,1191
7
7
  nfelodcm/nfelodcm/Engine/Assignments/assignments/__init__.py,sha256=9dMIp6FZu3ZrvTHomWqkzF77em8P9hxKhuXl-lIyRQ4,139
8
8
  nfelodcm/nfelodcm/Engine/Assignments/assignments/desc_based_plays.py,sha256=LAXOlE-IW8A49rRagxcAGRao_4c2RdC7AK6_iV3M2Vc,1810
9
9
  nfelodcm/nfelodcm/Engine/Assignments/assignments/fastr_team_repl.py,sha256=YD3ci5BsuEelFEuyRyUbAqSuAiBeIFsMuhTvXbvg6Ik,865
@@ -26,7 +26,7 @@ nfelodcm/nfelodcm/Utilities/extract_map.py,sha256=DVITMr0mlP6p2V1ZdaIcbEavs-FZ28
26
26
  nfelodcm/nfelodcm/Utilities/global_variables.json,sha256=FrKTTJ3VJRTV8RdQmjpXZzIPLLC594SpiMBR6xYs7Nw,299
27
27
  nfelodcm/nfelodcm/Utilities/retrieve_season_state.py,sha256=ZrBaMWmo2DA9OZqZ6MBWmrY9Llkc5OUfxmDk7EB1tRU,579
28
28
  nfelodcm/nfelodcm/Utilities/set_season_state.py,sha256=Y5fvop3EZfWcx2F85MtSNEGnwjofWyEMg4_HLTenAUA,3737
29
- nfelodcm-0.1.5.dist-info/METADATA,sha256=8Y8ZELVWSXq4bSaf8KE4OUoeTCRdKElSpqmCNcx3184,4409
30
- nfelodcm-0.1.5.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
31
- nfelodcm-0.1.5.dist-info/top_level.txt,sha256=SlNA7_yZSwWvZIl9Md6brBH_C7nAYnATe4CrvuUXOGo,9
32
- nfelodcm-0.1.5.dist-info/RECORD,,
29
+ nfelodcm-0.1.7.dist-info/METADATA,sha256=i33HF_CTQxLPayZsoNav3yyeHWywSuKmQHioMSBgIus,4409
30
+ nfelodcm-0.1.7.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
31
+ nfelodcm-0.1.7.dist-info/top_level.txt,sha256=SlNA7_yZSwWvZIl9Md6brBH_C7nAYnATe4CrvuUXOGo,9
32
+ nfelodcm-0.1.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: setuptools (70.1.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5