Exemplo n.º 1
0
 def test_sorting_B(self):
     dummyData = [('A',1,'M'),('B',2,'G'),('C',3,'A')]
     self.assertEqual([dummyData[p] for p in [1,0,2]],
             dfl_processor.sort_position_data(dummyData,'B'))
Exemplo n.º 2
0
        fname_pos = data_path + "ObservedPositionalData/BL/" + fname
        matchname = os.path.splitext(fname)[0]
    
        # Runs the parser
        print "Parsing match information"
        mip = prs.MatchInformationParser()
        mip.run(fname_match)
        teams, match = mip.getTeamInformation()
        print "Parsing event data"
        mep = prs.MatchEventParser()
        mep.run(fname_info)
        play_time, subs = mep.getEventInformation()
        print "Parsing position data"
        mpp = prs.MatchPositionParser(match,teams)
        mpp.run(fname_pos)
        pos_data,ball_data,time_stamps = mpp.getPositionInformation()
        
        # Runs the processor
        section = '2nd'
        kk = pos_data['home'][section]
        kks = prc.sort_position_data(kk)
        bb = ball_data[section!='1st']
        ss = prc.stitch_position_data(kks,bb)
        data_transformed = prc.run(pos_data,ball_data,match)
        
        # Runs the writer
        print "Step 3: Saving Information\n"
        matchdir(out_path+matchname)
        wrt.write_data_to_file(data_transformed,matchname)
        
Exemplo n.º 3
0
 def test_sorting_A(self):
     dummyData = [('A',1,'STZ'),('B',2,'DMZ'),('C',3,'LM')]
     self.assertEqual([dummyData[p] for p in [1,2,0]],
             dfl_processor.sort_position_data(dummyData))
Exemplo n.º 4
0
        fname_info = data_path + "Events/BL/" + fname
        fname_pos = data_path + "ObservedPositionalData/BL/" + fname
        matchname = os.path.splitext(fname)[0]

        # Runs the parser
        print("Parsing match information")
        mip = prs.MatchInformationParser()
        mip.run(fname_match)
        teams, match = mip.getTeamInformation()
        print("Parsing event data")
        mep = prs.MatchEventParser()
        mep.run(fname_info)
        play_time, subs = mep.getEventInformation()
        print("Parsing position data")
        mpp = prs.MatchPositionParser(match, teams)
        mpp.run(fname_pos)
        pos_data, ball_data, time_stamps = mpp.getPositionInformation()

        # Runs the processor
        section = '2nd'
        kk = pos_data['home'][section]
        kks = prc.sort_position_data(kk)
        bb = ball_data[section != '1st']
        ss = prc.stitch_position_data(kks, bb)
        data_transformed = prc.run(pos_data, ball_data, match)

        # Runs the writer
        print("Step 3: Saving Information\n")
        matchdir(out_path + matchname)
        wrt.write_data_to_file(data_transformed, matchname)