Commit dbbdcd0f authored by jay's avatar jay
Browse files

Fleshed out the graph example

parent cfd34230
Loading
Loading
Loading
Loading
+906 KiB
Loading image diff...
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ def get_path(example_name):
    elif example_name == "":
        return os.path.join(base, 'examples', example_name)
    else:
        raise KeyErro(example_name + 'not found in built-in examples')
        raise KeyError(example_name + 'not found in built-in examples')

def available(directory='', verbose=False):
    """
−12 B (1.69 KiB)

File changed.

No diff preview for this file type.

+8 −2
Original line number Diff line number Diff line
from collections import Hashable
from networkx import MultiDiGraph
from networkx import DiGraph

class CandidateGraph(MultiDiGraph):
class CandidateGraph(DiGraph):
    def __init__(self,*args, **kwargs):
        super(CandidateGraph,self).__init__(*args, **kwargs)

    def add_image(self, identifier):
        """
        Parameters
        ==========
        identifier : object
                     A Python hashable object to be used as the node key
        """
        if isinstance(identifier, Hashable):
            self.add_node(identifier)
        else:
+148 B (1.15 KiB)

File changed.

No diff preview for this file type.

Loading