1+
12import networkx as nx
23import torch
3- from typing import Tuple , Set , List
44from torch_geometric .utils .convert import from_networkx
55
66from modules .data .utils .utils import load_manual_graph
@@ -37,7 +37,7 @@ def setup_method(self):
3737 self .random_data ["x" ] = torch .rand ((5 , 1 ))
3838
3939
40- def has_neighbour (self , simplex_points : List [ Set ]) -> Tuple [bool , Set [int ]]:
40+ def has_neighbour (self , simplex_points : list [ set ]) -> tuple [bool , set [int ]]:
4141 """ Verifies that the maximal simplices
4242 of Data representation of a simplicial complex
4343 share a neighbour.
@@ -61,10 +61,10 @@ def test_lift_topology_random_graph(self):
6161 """
6262 lifted_data = self .lifting_high .forward (self .random_data )
6363 # For each set of simplices
64- r = max (int (key .split ('_' )[- 1 ]) for key in list (lifted_data .keys ()) if ' x_idx_' in key )
64+ r = max (int (key .split ("_" )[- 1 ]) for key in list (lifted_data .keys ()) if " x_idx_" in key )
6565 idx_str = f"x_idx_{ r } "
6666
67- # Go over each (max_dim)-simplex
67+ # Go over each (max_dim)-simplex
6868 for simplex_points in lifted_data [idx_str ]:
6969 share_neighbour = self .has_neighbour (simplex_points )
7070 assert share_neighbour , f"The simplex { simplex_points } does not have a common neighbour with all the nodes."
@@ -76,10 +76,10 @@ def test_lift_topology_star_graph(self):
7676 """
7777 lifted_data = self .lifting_high .forward (self .star_data )
7878 # For each set of simplices
79- r = max (int (key .split ('_' )[- 1 ]) for key in list (lifted_data .keys ()) if ' x_idx_' in key )
79+ r = max (int (key .split ("_" )[- 1 ]) for key in list (lifted_data .keys ()) if " x_idx_" in key )
8080 idx_str = f"x_idx_{ r } "
8181
82- # Go over each (max_dim)-simplex
82+ # Go over each (max_dim)-simplex
8383 for simplex_points in lifted_data [idx_str ]:
8484 share_neighbour = self .has_neighbour (simplex_points )
8585 assert share_neighbour , f"The simplex { simplex_points } does not have a common neighbour with all the nodes."
0 commit comments