Skip to content

Add DigraphByEdges variant for list of arbitrary vertex labels and list of edges - #957

Open
William-Kenyon wants to merge 8 commits into
digraphs:mainfrom
William-Kenyon:fix-issue-778
Open

William-Kenyon wants to merge 8 commits into
digraphs:mainfrom
William-Kenyon:fix-issue-778

Conversation

@William-Kenyon

Copy link
Copy Markdown
Collaborator

Fixes #778, for adding a way of constructing a Digraph with two lists: vertex_labels, and edges, where vertex labels can be more than just integers. This is basically the same as the existing 3-argument constructor (vertices, source, range), except source and range are zipped together.

Based on @wilfwilson's code snippet.

@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.47%. Comparing base (f4fc1ac) to head (65aa4d9).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
gap/digraph.gi 92.59% 2 Missing ⚠️

❌ 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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@William-Kenyon William-Kenyon added the VIP Pull requests done by participants of the VIP programme. label Oct 15, 2026

@james-d-mitchell james-d-mitchell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Comment thread gap/digraph.gi Outdated
Comment on lines +489 to +490
fi;
if not (IsSubset(vertex_labels, Union(edges))) then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment thread gap/digraph.gi Outdated
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>,");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@William-Kenyon William-Kenyon changed the title Add variant of Digraph constructor for list of vertex labels and list of edges Add DigraphByEdges variant for list of arbitrary vertex labels and list of edges Oct 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

VIP Pull requests done by participants of the VIP programme.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new variant/sibling of DigraphByEdges that can accept edges defined in terms of labelled vertices

2 participants