def setUpClass(cls):
     """
     Initialize dictionary objects
     """
     filename = "test_serialize_teammates.pickle"
     cls.dict = build_teammates.full_teammates()
     serialize.create_pickle(filename, cls.dict)
     cls.dict2 = serialize.load_pickle(filename)
 def setUpClass(cls):
     """
     Initialize creation of serialized dictionary
     """
     filename = "test_serialize.pickle"
     cls.dict = test_build_players.build_mini_player_dict()
     serialize.create_pickle(filename, cls.dict)
     cls.dict2 = serialize.load_pickle(filename)
Esempio n. 3
0
#!/usr/bin/env python
import context
import nbateammatechain.players.build_players as build_players
import nbateammatechain.utils.serialize as serialize
import shutil

player_dict = build_players.create_player_dict()
serialize.create_pickle("player_dict.pickle", player_dict)
shutil.move("player_dict.pickle", "../raw_files/")
Esempio n. 4
0
import nbateammatechain.utils.serialize as serialize

if player_update:
    print("To quit update, press Ctrl-C. You may need to press a few times.")
    import os
    import nbateammatechain.players.build_teammates as build_teammates
    import shutil

    player_dict = build_teammates.full_teammates()
    filename = "player_dict_full.pickle"
    try:
        os.remove(filename)
    except OSError:
        pass
    serialize.create_pickle(filename, player_dict)
    shutil.move(filename, "raw_files/")

print("\n\nLoading Player Data and Building Graph Connections...")
import nbateammatechain.graph.player_graph as graph
player_name_dict = serialize.load_pickle("raw_files/player_name_dict.pickle")
player_dict = serialize.load_pickle("raw_files/player_dict_full.pickle")
Graph = graph.Graph()

attr_key = [('Height', 'height'), ('Weight', 'weight'), ('Games Played', 'g'),
            ('Games Started', 'gs'), ('Career Minutes', 'mp'),
            ('Career Points', 'pts'), ('Career Assists', 'ast'),
            ('Career Rebounds', 'trb'), ('Career Steals', 'stl'),
            ('Career Blocks', 'blk'), ('Career Field Goals Attempted', 'fga'),
            ('Career Three Point Field Goals Attempted', 'fg3a'),
            ('Career Free Throws Attempted', 'fta'),