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_plot_js.py, graph_list.py and graph_input.py #26478
Comments
Branch: public/26478_cleaning |
Commit: |
comment:2
The most significant changes are in |
This comment has been minimized.
This comment has been minimized.
comment:3
For this change: - if not loops and any(u in neighb for u,neighb in six.iteritems(M)):
- if loops is False:
- u = next(u for u,neighb in six.iteritems(M) if u in neighb)
- raise ValueError("The graph was built with loops=False but input M has a loop at {}.".format(u))
- loops = True
- if loops is None:
- loops = False
+ if any(not isinstance(M[u], dict) for u in M):
+ raise ValueError("input dict must be a consistent format")
+
+ if not loops:
+ for u, neighb in six.iteritems(M):
+ if u in neighb:
+ if loops is False:
+ raise ValueError("the graph was built with loops=False but input M has a loop at {}".format(u))
+ loops = True
+ break
+ if loops is None:
+ loops = False the Also, strictly speaking, the items for All of the other changes LGTM. |
comment:5
The following lines are apparently incompatible with Python 3 (see patchbot). + if any(u in neighb for u,neighb in six.iteritems(M)):
+ u = next(u for u,neighb in six.iteritems(M) if u in neighb) + if any(u in neighb for u, neighb in six.iteritems(D)):
+ u = next(u for u, neighb in six.iteritems(M) if u in neighb) Is there a special trick or should I turn these lines to for loops ? |
comment:6
No, no. It's just the patchbot prefering "iteritems" to "six.iteritems". Just change the imports accordingly. And once again, it is never mandatory to have all green lights from the patchbot, as the patchbot is not smart.. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:8
Good to know. As I'm not Python 3 expert, I thought it could be something else. |
comment:10
Doctest failures:
and similar in |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:12
I fixed the doctests. Now waiting for the patchbot. |
comment:13
Thanks. |
Reviewer: Travis Scrimshaw |
comment:14
Merge conflict |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:16
I fixed the merge conflict with 8.5.beta0 |
Changed branch from public/26478_cleaning to |
clean the files (PEP8) and simplify some tests
CC: @tscrim
Component: graph theory
Author: David Coudert
Branch/Commit:
2cf89df
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/26478
The text was updated successfully, but these errors were encountered: