Beispiel #1
0
 def test_frame_to_graph_no_players(self):
     """Tests if frame to graph fails on no players in T or CT"""
     with pytest.raises(ValueError):
         X, A = frame_to_graph(
             frame=self.data["GameRounds"][-1]["Frames"][-1],
             metric="graph",
             map_name=self.data["MapName"],
         )
Beispiel #2
0
 def test_frame_to_graph_bad_map(self):
     """Tests if frame to graph fails on bad map name"""
     with pytest.raises(ValueError):
         X, A = frame_to_graph(
             frame=self.data["GameRounds"][0]["Frames"][0],
             metric="graph",
             map_name="not_a_correct_map_name",
         )
Beispiel #3
0
 def test_graph_output_non_graph_dist_not_full(self):
     """Tests if the graph output is of correct dimension using non-graph distance"""
     X, A = frame_to_graph(
         frame=self.data["GameRounds"][0]["Frames"][40],
         metric="euclidean",
         map_name=self.data["MapName"],
         full=False,
     )
     assert X.shape[0] == 5
     assert X.shape[1] == 9
     assert A.shape[0] == 5
     assert A.shape[1] == 5
Beispiel #4
0
 def test_graph_output_graph_dist(self):
     """Tests if the graph output is of correct dimension using graph distance"""
     X, A = frame_to_graph(
         frame=self.data["GameRounds"][0]["Frames"][0],
         metric="graph",
         map_name=self.data["MapName"],
         full=True,
     )
     assert X.shape[0] == 10
     assert X.shape[1] == 10
     assert A.shape[0] == 10
     assert A.shape[1] == 10
Beispiel #5
0
 def test_frame_to_graph_places(self):
     """Tests if frame to graph fails on places=True"""
     X, A = frame_to_graph(
         frame=self.data["GameRounds"][0]["Frames"][40],
         metric="euclidean",
         map_name=self.data["MapName"],
         full=True,
         places=True,
     )
     assert X.shape[0] == 10
     assert X.shape[1] == 120
     assert A.shape[0] == 10
     assert A.shape[1] == 10