• 
      

    Add Dijkstra's algorithm and graphutils module

    Review Request #7327 — Created May 21, 2015 and submitted

    Information

    Review Board
    dvcs
    f65ae49...

    Reviewers

    This patch adds the diffviewer.graphutils module which will contain
    general purpose graph algorithms, the first of which being Dijkstra's
    shortest path algorithm.

    Ran unit tests.

    Description From Last Updated

    Col: 1 W391 blank line at end of file

    reviewbot reviewbot

    Can you clarify in here exactly what the input and output formats are supposed to be? I can figure it …

    david david

    Col: 1 E302 expected 2 blank lines, found 1

    reviewbot reviewbot

    We should avoid using _ as a variable in any code, since by convention, we're using _ for gettext or …

    chipx86 chipx86

    It might be nicer to have one big assert statement (compare distances against a dict that you create).

    david david

    Same here.

    david david
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/diffviewer/graphutils.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/diffviewer/graphutils.py
      
      
    2. reviewboard/diffviewer/graphutils.py (Diff revision 1)
       
       
      Show all issues
      Col: 1
       W391 blank line at end of file
      
    3. 
        
    brennie
    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/diffviewer/graphutils.py
      
      
      
      Tool: Pyflakes
      Processed Files:
          reviewboard/diffviewer/graphutils.py
      
      
    2. 
        
    david
    1. Unit tests/testing done?

    2. reviewboard/diffviewer/graphutils.py (Diff revision 2)
       
       
       
       
      Show all issues

      Can you clarify in here exactly what the input and output formats are supposed to be? I can figure it out from the code, but it would be nice to just read it in the comment.

    3. 
        
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/diffviewer/tests.py
          reviewboard/diffviewer/graphutils.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/diffviewer/tests.py
          reviewboard/diffviewer/graphutils.py
      
      
    2. reviewboard/diffviewer/tests.py (Diff revision 3)
       
       
      Show all issues
      Col: 1
       E302 expected 2 blank lines, found 1
      
    3. 
        
    brennie
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/diffviewer/tests.py
          reviewboard/diffviewer/graphutils.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/diffviewer/tests.py
          reviewboard/diffviewer/graphutils.py
      
      
    2. 
        
    david
    1. 
        
    2. reviewboard/diffviewer/tests.py (Diff revision 4)
       
       
       
       
       
       
       
       
       
       
       
      Show all issues

      It might be nicer to have one big assert statement (compare distances against a dict that you create).

    3. reviewboard/diffviewer/tests.py (Diff revision 4)
       
       
       
       
       
       
       
       
       
       
      Show all issues

      Same here.

    4. 
        
    chipx86
    1. 
        
    2. reviewboard/diffviewer/graphutils.py (Diff revision 4)
       
       
      Show all issues

      We should avoid using _ as a variable in any code, since by convention, we're using _ for gettext or gettext_lazy. Maybe unused?

    3. 
        
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/diffviewer/tests.py
          reviewboard/diffviewer/graphutils.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/diffviewer/tests.py
          reviewboard/diffviewer/graphutils.py
      
      
    2. 
        
    brennie
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to dvcs (e736879)