| 594 | } |
| 595 | |
| 596 | py::object DiGraph::get_edges() { |
| 597 | py::list edges = py::list(); |
| 598 | std::set<std::pair<node_t, node_t> > seen; |
| 599 | for (const auto& ego_edges : this->adj) { |
| 600 | node_t u = ego_edges.first; |
| 601 | for (const auto& edge_info : ego_edges.second) { |
| 602 | node_t v = edge_info.first; |
| 603 | const auto& edge_attr = edge_info.second; |
| 604 | if (seen.find(std::make_pair(u, v)) == seen.end()) { |
| 605 | seen.insert(std::make_pair(u, v)); |
| 606 | edges.append(py::make_tuple(this->id_to_node[py::cast(u)], this->id_to_node[py::cast(v)], |
| 607 | attr_to_dict(edge_attr))); |
| 608 | } |
| 609 | } |
| 610 | } |
| 611 | return edges; |
| 612 | } |
| 613 |
nothing calls this directly
no test coverage detected