MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / Graph_add_edges

Function Graph_add_edges

cpp_easygraph/classes/graph.cpp:265–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265py::object Graph_add_edges(Graph& self, py::list edges_for_adding, py::list edges_attr) {
266 self.dirty_nodes = true;
267 self.dirty_adj = true;
268 self.linkgraph_dirty = true;
269 if (py::len(edges_attr) != 0) {
270 if (py::len(edges_for_adding) != py::len(edges_attr)) {
271 PyErr_Format(PyExc_AssertionError, "Edges and Attributes lists must have same length.");
272 return py::none();
273 }
274 }
275 for (int i = 0; i < py::len(edges_for_adding); i++) {
276 py::tuple one_edge_for_adding = edges_for_adding[i].cast<py::tuple>();
277 py::dict edge_attr;
278 if (py::len(edges_attr)) {
279 edge_attr = edges_attr[i].cast<py::dict>();
280 } else {
281 edge_attr = py::dict();
282 }
283 _add_one_edge(self, one_edge_for_adding[0], one_edge_for_adding[1], edge_attr);
284 }
285 return py::none();
286}
287
288py::object Graph_add_edges_from(py::args args, py::kwargs attr) {
289 Graph& self = args[0].cast<Graph&>();

Callers

nothing calls this directly

Calls 1

_add_one_edgeFunction · 0.85

Tested by

no test coverage detected