MCPcopy Create free account
hub / github.com/Tencent/embedx / run

Method run

demo/data/scripts/embedx_graph.py:233–253  ·  view source on GitHub ↗
(self, dst_dir)

Source from the content-addressed store, hash-verified

231 self.embedx_graph = EmbedxGraph(nx_graph)
232
233 def run(self, dst_dir):
234 if not os.path.isdir(dst_dir):
235 os.mkdir(dst_dir)
236
237 def get_full_path(path):
238 return os.path.join(dst_dir, path)
239
240 self.embedx_graph.write_context(
241 get_full_path(EmbedxGraphGenerator.CONTEXT_FILE_NAME))
242
243 self.embedx_graph.write_node_label(
244 get_full_path(EmbedxGraphGenerator.LABELS_FILE_NAME),
245 get_full_path(EmbedxGraphGenerator.TRAIN_LABELS_FILE_NAME),
246 get_full_path(EmbedxGraphGenerator.TEST_LABELS_FILE_NAME))
247
248 if self.embedx_graph.has_feature:
249 self.embedx_graph.write_node_feature(
250 get_full_path(EmbedxGraphGenerator.NODE_FEATURE_FILE_NAME),
251 get_full_path(EmbedxGraphGenerator.GROUP_CONFIG_FILE_NAME))
252
253 self.print_graph_statistics()
254
255 def print_graph_statistics(self):
256 for stat in self.embedx_graph.statistics():

Callers 1

generate_embedx_graphFunction · 0.95

Calls 4

write_contextMethod · 0.80
write_node_labelMethod · 0.80
write_node_featureMethod · 0.80

Tested by

no test coverage detected