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
clean graph.py #26432
Comments
Commit: |
New commits:
|
Branch: u/dcoudert/26432_clean_graph_py |
Branch pushed to git repo; I updated commit sha1. New commits:
|
This comment has been minimized.
This comment has been minimized.
comment:3
So far, remaining issues are:
Any advise is more than welcome. |
comment:4
Edit: sorry, I was wrong about this. It does not help with the homology doctests. |
comment:5
Small things that I think should be fixed before a positive review:
While I understand why, it still looks ugly
probably better to also move down The bullet points are over-indented: Here are two very simple modules :
- * A connected component `C` (or the union of some --but
- not all-- of them) of a disconnected graph `G`, for
- instance, is a module, as no vertex of `C` has a
- neighbor outside of it.
+ * A connected component `C` (or the union of some --but not all-- of
+ them) of a disconnected graph `G`, for instance, is a module, as
+ no vertex of `C` has a neighbor outside of it.
- * An anticomponent `C` (or the union of some --but not
- all-- of them) of an non-anticonnected graph `G`, for
- the same reason (it is just the complement of the
- previous graph !).
+ * An anticomponent `C` (or the union of some --but not all-- of
+ them) of an non-anticonnected graph `G`, for the same reason (it
+ is just the complement of the previous graph !). I would move off on the |
comment:7
Thanks for all the comments. I will modify I have removed sorting from several example. Was not needed. Concerning the sorting of output in |
comment:8
Replying to @dcoudert:
I would say it is fine. There is not a decent reason I can think of why someone should be assuming the output is sorted. Nor was it documented that the output was sorted. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:11
Concerning the removal of sorting. It was easier than expected and I have not noticed any impact on other methods. After that I did additional improvements in INPUT blocks and lambda statements. Further improvements are certainly possible like moving references to the global file, but I suggest to do that only after the giant patch #26423 is closed. |
comment:12
Thanks. LGTM. |
Reviewer: Travis Scrimshaw |
comment:13
The + @@ -2141,34 +2117,40 @@ class Graph(GenericGraph):
+ for u,d in six.iteritems(H.degree(labels=True)):
Python3 incompatible code inserted on 1 non-empty lines I'm pushing a small change to fix that. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
What was there was correct and works on python3, that is what six does. However, in this case, this makes the code a little easier to understand, although not by much. So I will keep the change. |
comment:16
Thank you. |
Changed branch from u/dcoudert/26432_clean_graph_py to |
comment:18
This should be re-targeted for 8.5. |
We do as much cleaning as possible: alignments, PEP8, avoid many vertex comparisons or sorting, etc.
CC: @tscrim @fchapoton
Component: graph theory
Author: David Coudert
Branch/Commit:
20bf46b
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/26432
The text was updated successfully, but these errors were encountered: