-
-
Notifications
You must be signed in to change notification settings - Fork 552
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
"immutable=True" for Graph/Digraph __init__ and copy() #15603
Comments
This comment has been minimized.
This comment has been minimized.
Dependencies: #15278 |
Changed branch from #15278 to u/ncohen/15603 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:5
What do you think ? Nathann |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:7
The commit looks good, except for the spaces in front of colons and question marks... Do you add this space in your smileys, too? I think we agreed that we'll use a new ticket to fix sage.combinat's hack with |
comment:8
Yoooooo !
Argggggg Well right now I'm trying to read a spanish book (even though I don't speak a word of it)... At least I don't put their weird reversed question marks in the code
Yepyepyep, sounds right. Nathann |
comment:9
All tests pass, but I think I'll add a review commit, a bit later. |
comment:10
Things that need to be done (in a review commit): In some place you explain the If the ``data_structure`` is equal to ``"static_sparse"``, then an
immutable graph results. Note that this does not use the NetworkX data
structure::
- sage: G_imm = Graph(g, data_structure="static_sparse")
- sage: H_imm = Graph(g, data_structure="static_sparse")
+ sage: G_imm = Graph(g, immutable=True)
+ sage: H_imm = Graph(g, immutable=True)
sage: G_imm == H_imm == G == H
True Hence, the text is about data_structure, but you remove it from the test. |
comment:11
"that need to be done" : will that be your review commit, or do you want me to do that ? Nathann |
comment:12
Replying to @nathanncohen:
I wrote "that need to be done (in a review commit)". Hence, I'll do it. |
comment:13
Oops sorry. I missed that, in my eagerness to see these patches in Sage Nathann |
comment:14
There is a naked
Should we care? |
comment:15
Should the error message mention the other (more intuitive) possibility |
comment:16
Hmmmm... We could add an empty function for Yes to your other comment about the exception raised by Nathann |
comment:17
Since I want this to get over with and since my family plans to have an excursion today, I prefer to only fix the error message raised by |
comment:18
Ahahahah. Okay no prob. I'll fix that later in another patch Nathann |
Changed branch from u/ncohen/15603 to u/SimonKing/ticket/15603 |
Reviewer: Simon King |
comment:20
I have added a review commit and run all tests in src/sage/graphs without error. Positive review (unless your aren't happy with my review commit or find that surprisingly the new error message appears in other parts of Sage too). New commits:
|
comment:21
NOnono that' s great ! Thanks Nathann |
As promised on #15278, this ticket adds an 'immutable' keyword to the constructors of
Graph/Digraph
, and in 'copy()' too.While I was at it, I tried to clean a bit the 'copy()' method, which now systematically checks its input. It should deal with every situation
:-P
And I think I will have to clean the constructors of
Graph/Digraph
too at some point.Nathann
Depends on #15278
CC: @simon-king-jena
Component: graph theory
Author: Nathann Cohen
Branch/Commit: u/SimonKing/ticket/15603 @
b741bd4
Reviewer: Simon King
Issue created by migration from https://trac.sagemath.org/ticket/15603
The text was updated successfully, but these errors were encountered: