#26823 closed enhancement (fixed)
pep8 cleaning in distances methods
Reported by:  dcoudert  Owned by:  

Priority:  major  Milestone:  sage8.6 
Component:  graph theory  Keywords:  
Cc:  Merged in:  
Authors:  David Coudert  Reviewers:  Vincent Klein 
Report Upstream:  N/A  Work issues:  
Branch:  2ff0fd2 (Commits)  Commit:  2ff0fd2e80dfebb4b4dfd3e37501fc8f4004f711 
Dependencies:  Stopgaps: 
Description (last modified by )
We do pep8 cleaning in methods all_paths
, shortest_path
, shortest_path_length
, _check_weight_function
, shortest_paths
, shortest_path_lengths
, shortest_path_all_pairs
.
Change History (13)
comment:1 Changed 23 months ago by
 Branch set to public/26823_clean_distance_methods
 Commit set to 9dd97bdc56820bbfbf02cce9d3f7515d02e5bf51
 Description modified (diff)
 Status changed from new to needs_review
comment:2 Changed 23 months ago by
 Owner changed from (none) to vklein
comment:3 Changed 23 months ago by
python remark: I think there is a bad copypaste line 15709.
if not self.has_vertex(u): raise ValueError("vertex '{}' is not in the (di)graph".format(u)) if not self.has_vertex(u): raise ValueError("vertex '{}' is not in the (di)graph".format(u))
pep8 remarks:
 1. Missing whitespace around operator:
l 15278: s=start
 2. At least two spaces before inline comment:
l 15289: s = next(act_path_iter[1]) # try to get the next neighbor/successor, ...
l 15553: if u == v: # to avoid a NetworkX bug
l 15714: # to avoid a NetworkX bug
 3. Do not assign a lambda expression use a def:
l 15551, 15724, 15947, 16167, 16450, 16490, 16516: weight_function = lambda e: e[2]
l 15564, 15736, 15949, 16169, 16481: weight_function = lambda e: 1
 4. Too many blank lines:
l 15557
 5. Missing whitespace:
l 15984: _,pred = ...
l 16492: dist[u],pred[u] = ...
comment:4 Changed 23 months ago by
 Owner changed from vklein to (none)
comment:5 Changed 23 months ago by
 Reviewers set to Vincent Klein
comment:6 Changed 23 months ago by
 Commit changed from 9dd97bdc56820bbfbf02cce9d3f7515d02e5bf51 to 6c67fc025f88688fe552f7c25427c31afaafb1af
Branch pushed to git repo; I updated commit sha1. New commits:
6c67fc0  trac #26823: reviewer's comments

comment:7 Changed 23 months ago by
I have implemented all your comments. Thank you.
comment:8 Changed 23 months ago by
You're welcome.
There is one remaining weight_function = lambda e: 1
in shortest_path_all_pairs
line 16487.
comment:9 Changed 23 months ago by
 Commit changed from 6c67fc025f88688fe552f7c25427c31afaafb1af to 2ff0fd2e80dfebb4b4dfd3e37501fc8f4004f711
Branch pushed to git repo; I updated commit sha1. New commits:
2ff0fd2  trac #26823: another lambda

comment:10 Changed 23 months ago by
oups. Fixed.
comment:11 Changed 23 months ago by
 Status changed from needs_review to positive_review
comment:12 Changed 22 months ago by
 Branch changed from public/26823_clean_distance_methods to 2ff0fd2e80dfebb4b4dfd3e37501fc8f4004f711
 Resolution set to fixed
 Status changed from positive_review to closed
comment:13 Changed 22 months ago by
 Milestone changed from sage8.5 to sage8.6
This tickets were closed as fixed after the Sage 8.5 release.
New commits:
trac #26823: pep8 in distance methods