示例#1
0
 def gen_graph(self, graph_name):
     # check whether we are loading from file
     if "." in graph_name:
         abspath = network_dir + graph_name
         di_instructions = self.parser.get_graph_options(graph_name)
         graph = nngt.Graph.from_file(abspath, **di_instructions)
         graph.set_name(graph_name)
         return graph, None
     else:
         di_instructions = self.parser.get_graph_options(graph_name)
         graph = nngt.generate(di_instructions)
         graph.set_name(graph_name)
         graph.to_file(current_dir + graph_name + '.el')
         return graph, di_instructions
示例#2
0
 def gen_graph(self, graph_name):
     di_instructions = self.parser.get_graph_options(graph_name)
     graph = nngt.generate(di_instructions)
     graph.set_name(graph_name)
     return graph, di_instructions
示例#3
0
 def gen_graph(self, graph_name):
     di_instructions = self.parser.get_graph_options(graph_name)
     graph = nngt.generate(di_instructions)
     graph.set_name(graph_name)
     return graph, di_instructions
示例#4
0
文件: test_mpi.py 项目: SBottani/NNGT
 def gen_graph(self, graph_name):
     di_instructions = self.parser.get_graph_options(graph_name)
     graph = nngt.generate(di_instructions)
     if nngt.on_master_process():
         graph.set_name(graph_name)
     return graph, di_instructions