Ejemplo n.º 1
0
def test_smallworldness():
    """
    Test small-world coefficient (omega) computation
    """
    base_dir = str(Path(__file__).parent/"examples")
    est_path = f"{base_dir}/miscellaneous/sub-0021001_rsn-Default_nodetype-parc_model-sps_template-MNI152_T1_thrtype-DENS_thr-0.19.npy"

    in_mat = np.load(est_path)
    G = nx.from_numpy_array(in_mat)

    sigma = netstats.smallworldness(G, niter=5, nrand=5, approach='clustering', reference='random')

    # A network is smallworld if sigma > 1
    assert sigma > 1
Ejemplo n.º 2
0
def test_smallworldness():
    """
    Test small-world coefficient (omega) computation
    """
    base_dir = str(Path(__file__).parent / "examples")
    est_path = f"{base_dir}/miscellaneous/0021001_rsn-Default_nodetype-parc_est-sps_thrtype-DENS_thr-0.19.npy"

    in_mat = np.load(est_path)
    G = nx.from_numpy_array(in_mat)

    omega = netstats.smallworldness(G, niter=5, nrand=5)

    # A network is smallworld if omega > 1
    assert omega > 1