#26820 closed enhancement (fixed)
pep8 cleaning in eccentricity, center, radius, diameter, periphery
Reported by:  David Coudert  Owned by:  

Priority:  major  Milestone:  sage8.6 
Component:  graph theory  Keywords:  py3, graph 
Cc:  Merged in:  
Authors:  David Coudert  Reviewers:  Vincent Klein 
Report Upstream:  N/A  Work issues:  
Branch:  63b1806 (Commits, GitHub, GitLab)  Commit:  63b18061fc519b53b6c44ce364f363a7d8943a3f 
Dependencies:  Stopgaps: 
Description
PEP8 cleaning in methods eccentricity
, radius
, diameter
, center
, periphery
. On the way, we do:
 in
radius
,center
,periphery
: replace the long description of the list of algorithms by a forward to methodeccentricity
 in
radius
,diameter
,center
,periphery
: set parameterv
when calling methodeccentricity
in order to avoid calls to.vertices()
Change History (9)
comment:1 Changed 4 years ago by
Branch:  → public/26820_eccentricity 

Commit:  → dd570a5bffd26e2411e18d8fc47edb33629badf6 
Status:  new → needs_review 
comment:2 Changed 4 years ago by
Hi,
What is the goal of this ticket? Is it to enhance compatibility with pep8 or to be fully compatible with pep8?
In the second case i have the following remarks:
 1. line 14069:
weight_function = lambda e: e[2]
. Do not assign a lambda expression use a def.
Pep8 quote:
Always use a def statement instead of an assignment statement that binds a lambda
expression directly to an identifier.Yes:
def f(x): return 2*x
No:
f = lambda x: 2*x
 2. lines 14122 and 14123: continuation line underindented for visual indent
for example you can do this :
length = self.shortest_path_lengths(u, by_weight=by_weight, algorithm=algorithm, weight_function=weight_function, check_weight=check_weight)
instead of this :
length = self.shortest_path_lengths(u, by_weight=by_weight, algorithm=algorithm, weight_function=weight_function, check_weight=check_weight)
 3. line 14135: Need two spaces before inline comment.
comment:3 Changed 4 years ago by
Reviewers:  → Vincent Klein 

comment:4 Changed 4 years ago by
Commit:  dd570a5bffd26e2411e18d8fc47edb33629badf6 → 63b18061fc519b53b6c44ce364f363a7d8943a3f 

Branch pushed to git repo; I updated commit sha1. New commits:
63b1806  trac #26820: reviewer's comments

comment:5 Changed 4 years ago by
I have implemented your comments. Thank you.
The goal is to do significant enhancements, and if possible to reach 100% pep8 compatibility (a lot to do for that).
comment:7 Changed 4 years ago by
Status:  needs_review → positive_review 

comment:8 Changed 4 years ago by
Branch:  public/26820_eccentricity → 63b18061fc519b53b6c44ce364f363a7d8943a3f 

Resolution:  → fixed 
Status:  positive_review → closed 
comment:9 Changed 4 years ago by
Milestone:  sage8.5 → sage8.6 

This tickets were closed as fixed after the Sage 8.5 release.
New commits:
trac #26820: clean eccentricity, radius, diameter, center, periphery