Commit 50d87a17 authored by Kelvinrr's avatar Kelvinrr
Browse files

not longer string only, change notebooks with function passes for demo

parent ad74579e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -374,12 +374,15 @@ class CandidateGraph(nx.Graph):
        else:
            edges_to_iter = self.edges()

        if not isinstance(func, str):
            func = func.__name__

        for s, d in edges_to_iter:
            curr_edge = self.get_edge_data(s, d)
            try:
                function = getattr(curr_edge, func)
            except:
                raise AttributeError('The passed function is not an attribute of Edge')
                raise AttributeError(func, ' is not an attribute of Edge')
            else:
                function(*args, **kwargs)

+24 −23

File changed.

Preview size limit exceeded, changes collapsed.