-
-
Notifications
You must be signed in to change notification settings - Fork 671
added a new clear method to clear all vertices, edges, left and right sets #39760
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
added a new clear method to clear all vertices, edges, left and right sets #39760
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.
This fixes the issue. Thanks.
It remains to comply with the coding style:
- add an empty line before the method
- add an empty line after
Clear all the vertices and edges in the graph.
- add an EXAMPLES block showing that it's working well. There is no need to repeat all the examples of method
clear
from generic graph.
src/sage/graphs/bipartite_graph.py
Outdated
""" | ||
Clear all the vertices and edges in the graph. | ||
This method will also clear the left and right vertex sets. |
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.
Something like that would be more informative
This method extends the functionality of method :meth:`~sage.graphs.generic_graph.GenericGraph.clear` to also clear vertex sets `left` and `right`.
src/sage/graphs/bipartite_graph.py
Outdated
EXAMPLES:: | ||
sage: B = BipartiteGraph(graphs.CompleteBipartiteGraph(7, 9)) |
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.
a smaller example like graphs.CycleGraph(4)
or even a single edge is sufficient.
@dcoudert I have incorporated the improvements, please tell me if further improvements are needed. |
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.
ensure that comments are on 80 columns mode and use double `
so ``left``
@dcoudert I had incorporated the changes |
src/sage/graphs/bipartite_graph.py
Outdated
""" | ||
Clear all the vertices and edges in the graph. | ||
This method extends the functionality of method :meth:`~sage.graphs.generic_graph.GenericGraph.clear` |
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 method extends the functionality of method
:meth:`~sage.graphs.generic_graph.GenericGraph.clear`
to also clear vertex sets ``left`` and ``right``.
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.
done
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.
There is a misunderstanding: I was not asking for removing the one line description of the method. Please restore Clear all the vertices and edges in the graph.
@dcoudert done |
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.
LGTM.
Tested on my laptop as I cannot launch the CIs.
While this fixes the immediate issue, it doesn't fix the underlying issue. In particular
The reason is Once |
If I understand well, you propose to close and forget this PR and open a new one to fix |
Yes. |
@Krishnadubey1008, are you able to do the requested new PR ? |
yes, i can try. should I open a new issue or try fix it in this PR itself |
open a new PR. The issue remains #39756 |
This PR can be closed. A better fix is proposed in #39813. Thank you @Krishnadubey1008 for the work. |
This PR fixes #39756
Added a new clear() method in the BipartiteGraph class to clear the left and right sets.
Please review the changes and let me know if any further improvements needed.
📝 Checklist
⌛ Dependencies