Repository navigation
feat: Vertex.edges_to() lists every edge from a vertex to another - #48
Merged
Merged
Conversation
edgeto() returns the one edge a path would use, the cheapest of any parallel edges. There was no way to see the parallel edges themselves other than filtering incidences() by hand. edges_to() returns all of them, in connection order, as a new list: empty rather than an error when there are none, only the edges from self to dest for a directed graph, and an undirected self-loop once, not once per end. edgeto() is now built on it with the same result, and says adjacent rather than neighbour. The seealso links join the two and the edge-list family. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 17 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #48 +/- ##
==========================================
+ Coverage 95.27% 95.37% +0.10%
==========================================
Files 3 3
Lines 1271 1277 +6
==========================================
+ Hits 1211 1218 +7
+ Misses 60 59 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
Vertex.edges_to(dest), which returns every edge from a vertex to another vertex.edgeto(dest)is unchanged: it returns the one edge a path would use, the cheapest of any parallel edges, and the planners and RTB'sLatticePlannerrely on that.There was no way to inspect parallel edges short of filtering
incidences()by hand.Behaviour
edgetostill raisesValueError).selftodest, soa.edges_to(b)andb.edges_to(a)differ.edgetois now implemented on top ofedges_towith the same result. Its precis and wording say "adjacent" rather than "neighbour".:seealso:links joinedgetoandedges_to, andedges_tois added to theedges,out_edgesandincidencesfamilies.Tests
tests/test_edges_to.py(24, both graph kinds): single and parallel edges and their order,edgetois the cheapest ofedges_to, absence, other destinations excluded, loops (single and parallel), a new list, removal, undirected from either end including edges connected from the other end, directed one-way and opposite edges separate.🤖 Generated with Claude Code