Repository navigation
Add DigraphByEdges variant for list of arbitrary vertex labels and list of edges - #957
William-Kenyon wants to merge 8 commits into
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (92.85%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #957 +/- ##
=======================================
Coverage 97.47% 97.47%
=======================================
Files 51 53 +2
Lines 21301 21391 +90
Branches 639 639
=======================================
+ Hits 20763 20851 +88
- Misses 473 475 +2
Partials 65 65 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
james-d-mitchell
left a comment
There was a problem hiding this comment.
Thanks for the PR @William-Kenyon. I think what you've implemented should be a method for DigraphByEdges and not an overload of Digraph though. Can you please update it so that it is this, and address the other comments too? Thanks!
| fi; | ||
| if not (IsSubset(vertex_labels, Union(edges))) then |
There was a problem hiding this comment.
| fi; | |
| if not (IsSubset(vertex_labels, Union(edges))) then | |
| elif not IsSubset(vertex_labels, Union(edges)) then |
save one line, and the brackets are superfluous, so please remove.
| ErrorNoReturn("<vertex_labels> contains duplicate labels,"); | ||
| fi; | ||
| if not (IsSubset(vertex_labels, Union(edges))) then | ||
| ErrorNoReturn("<edges> references a label that isn't in <vertex_labels>,"); |
There was a problem hiding this comment.
It's be useful if this line could include some details of which label is bad (position, and value), and the value of vertex_labels maybe too?
Digraph constructor for list of vertex labels and list of edgesDigraphByEdges variant for list of arbitrary vertex labels and list of edges
Fixes #778, for adding a way of constructing a
Digraphwith two lists:vertex_labels, andedges, where vertex labels can be more than just integers. This is basically the same as the existing 3-argument constructor (vertices,source,range), exceptsourceandrangeare zipped together.Based on @wilfwilson's code snippet.