-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performance of CopyDigraph #331
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @marinaanagno, this looks good to me. There's just one change I'd suggest: when you changed the name of the function, you forgot to delete its old declaration, which is easily done since it's in a different file!
gap/digraph.gd
Outdated
@@ -14,6 +14,7 @@ DeclareCategory("IsDigraphWithAdjacencyFunction", IsDigraph); | |||
DeclareCategory("IsCayleyDigraph", IsDigraph); | |||
DeclareCategory("IsImmutableDigraph", IsDigraph); | |||
DeclareSynonym("IsMutableDigraph", IsDigraph and IsMutable); | |||
DeclareFilter("IsNotDefaultEdgeLabelled", IsDigraph); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DeclareFilter("IsNotDefaultEdgeLabelled", IsDigraph); |
I think you meant to delete this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @MTWhyte! Just did this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @marinaanagno! Let's see if @james-d-mitchell has anything to say before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. It's missing some tests, but otherwise, I'll be happy to merge it. Please add the at least one test of this, perhaps the example in the referenced issue?
@marinaanagno @samanthaharper I'm happy with this except one thing, you added some whitespace in 3 places, I just updated the PR to remove it, when the CI runs we can merge this. |
We added a filter called
IsNotDefaultEdgeLabelled
that changes to true when we set edge labels and changes back into false when we clear them, so now when we copy digraphs edges are only copied if they are not the default ones, which improves efficiency.This addresses issue #292.