dcayton commited on
Commit
c9e8cb4
1 Parent(s): b2b7c9c

undo bound on total num games loaded

Browse files
Files changed (1) hide show
  1. nba_tracking_data_15_16.py +3 -13
nba_tracking_data_15_16.py CHANGED
@@ -11,7 +11,6 @@
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
  # See the License for the specific language governing permissions and
13
  # limitations under the License.
14
- # TODO: Address all TODOs and remove all explanatory comments
15
  """This is tracking data of the 2015-2016 NBA season"""
16
 
17
  import csv
@@ -47,9 +46,8 @@ res = requests.get(_URL)
47
 
48
  items = res.json()['payload']['tree']['items']
49
 
50
- # trying subset of games
51
  _URLS = {}
52
- for game in items[0:2]:
53
  name = game['name'][:-3]
54
  _URLS[name] = _URL + "/" + name + ".7z"
55
 
@@ -167,13 +165,7 @@ class NbaTracking(datasets.GeneratorBasedBuilder):
167
  )
168
 
169
  def _split_generators(self, dl_manager):
170
- # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
171
-
172
- # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
173
- # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
174
- # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
175
- # urls = _URLS[self.config.name]
176
- urls = self._URLS # trying Ouwen's format
177
  data_dir = dl_manager.download_and_extract(urls)
178
 
179
  all_file_paths = {}
@@ -191,10 +183,8 @@ class NbaTracking(datasets.GeneratorBasedBuilder):
191
  )
192
  ]
193
 
194
- # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
195
  def _generate_examples(self, filepaths, split):
196
- # TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
197
- # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
198
  pbp_out = datasets.DownloadManager().download_and_extract(_PBP_URL)
199
  pbp = pd.read_csv(pbp_out)
200
 
 
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
  # See the License for the specific language governing permissions and
13
  # limitations under the License.
 
14
  """This is tracking data of the 2015-2016 NBA season"""
15
 
16
  import csv
 
46
 
47
  items = res.json()['payload']['tree']['items']
48
 
 
49
  _URLS = {}
50
+ for game in items:
51
  name = game['name'][:-3]
52
  _URLS[name] = _URL + "/" + name + ".7z"
53
 
 
165
  )
166
 
167
  def _split_generators(self, dl_manager):
168
+ urls = self._URLS
 
 
 
 
 
 
169
  data_dir = dl_manager.download_and_extract(urls)
170
 
171
  all_file_paths = {}
 
183
  )
184
  ]
185
 
186
+
187
  def _generate_examples(self, filepaths, split):
 
 
188
  pbp_out = datasets.DownloadManager().download_and_extract(_PBP_URL)
189
  pbp = pd.read_csv(pbp_out)
190