-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add edge_index_map() method to graph classes (#324)
* Add edge_index_map() method to graph classes This commit adds a new function edge_index_map() which will return a mapping from edge indices to a tuple of the node indices and weight for the edge. * Fix lint * Add release note * Add custom return type tests * Add tests for method * Apply suggestions from code review Co-authored-by: Ali Javadi-Abhari <[email protected]>
- Loading branch information
Showing
9 changed files
with
492 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
features: | ||
- | | ||
Added a new method, :meth:`~retworkx.PyDiGraph.edge_index_map`, to the | ||
:class:`~retworkx.PyDiGraph` and :class:`~retworkx.PyGraph` | ||
(:meth:`~retworkx.PyGraph.edge_index_map`) that will return a read-only | ||
mapping of edge indices to a tuple of the form | ||
``(source_node_index, target_node_index, weight/data payload)`` for every edge in the | ||
graph object. | ||
- | | ||
Added a new custom return type :class:`~retworkx.EdgeIndexMap` which is | ||
returned by :meth:`retworkx.PyDiGraph.edge_index_map` and | ||
:meth:`retworkx.PyGraph.edge_index_map`. It is equivalent to a read-only | ||
dict/mapping that represent a mapping of edge indices to the edge. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.