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
Refactor Graph.__init__ #19381
Comments
Last 10 new commits:
|
Commit: |
Branch: u/ncohen/19381 |
comment:2
Would it be possible in this ticket to add support for constructing a graph by
I know I can do it like this
but this is somewhat cumbersome (and doesn't work for graphs with labeled (multiple) edges). The other way I know how to do this is I have to pass the edge set, then add the vertices. The reason I ask is because I have wanted to create immutable graphs with larger vertex sets than the connectivity of the edges and I don't want to have to waste time copying a mutable graph backend into the static backend. (As an additional reason, it also follows the basic intro to combinatorics definition of a graph.) I should also be able to review this ticket too (and I definitely will if you make the above change). |
comment:3
Certainly not in this ticket. It refactors code, and it is already (as you can see) a lot to review. I guess it can be done in another ticket, though, I don't thing that there is any problem. With 5-6 lines any ambiguity with the other kind of inputs can be cleared ([V,f], list_of_edges, ...)
See also Nathann |
comment:4
Preliminary tests are ok and the doc build and display properly. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:6
hey, your commit messages have the ticket number wrong... |
comment:7
For me the patch is good to go, but I don't know if Nathann has something to do about the commit ticket numbers... Note: the (possible) segfault in the test |
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
|
comment:9
Replying to @dcoudert:
well, he adds these numbers by hand.
|
Reviewer: David Coudert |
comment:10
Then let's go! |
comment:11
Thaaaaaaaaanks for this quick review Nathann |
Changed branch from u/ncohen/19381 to |
This (very unpleasant) ticket attempts to clean a bit more the content of
Graph.__init__
.To this end, it creates a
graph_input
modules that gathers into individual functions the different pieces of code that build a graph from .Admittedly, this is just one step toward a cleaner graph constructor, but we are not there yet.
Nothing smart is done in this branch: the pieces of code from
Graph.__init__
are moved to new individual functions (some variables/parameters are renamed). One fromDiGraph.__init__
is moved too.In particular, some pieces of code from
DiGraph.__init__
may eventually be merged with the functions that this branch creates, but this will be done later.This branch is already sufficiently long and sufficiently unpleasant to write/review
:-/
Nathann
CC: @sagetrac-borassi @dcoudert @dimpase @videlec
Component: graph theory
Author: Nathann Cohen
Branch/Commit:
9bdf527
Reviewer: David Coudert
Issue created by migration from https://trac.sagemath.org/ticket/19381
The text was updated successfully, but these errors were encountered: