This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
class NodesView(object): | |
def __init__(self, graph, data=False, default=None): | |
self.G = graph | |
self.data = data | |
self.default = default | |
def __iter__(self): | |
data=self.data | |
if data is True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from timeit import Timer | |
# This is gratefully modeled after the benchmarks found in | |
# the numpy svn repository. http://svn.scipy.org/svn/numpy/trunk | |
import networkx as nx | |
class Benchmark(object): | |
""" | |
Benchmark a method or simple bit of code using different Graph classes. |