def test_get_connectome():
    (adj, coord) = _make_connectome()
    connectome = html_connectome._get_connectome(adj, coord)
    con_x = decode(connectome['_con_x'], '<f4')
    expected_x = np.asarray([0, 0, 0, 0, 20, 0, 10, 10, 0, 10, 30, 0, 20, 0, 0, 20, 20, 0, 20, 40, 0, 30, 10, 0, 30, 30, 0, 40, 20, 0, 40, 40, 0], dtype='<f4')
    assert (con_x == expected_x).all()
    assert {'_con_x', '_con_y', '_con_z', '_con_w', 'colorscale'}.issubset(connectome.keys())
    assert ((connectome['cmin'], connectome['cmax']) == ((- 2.5), 2.5))
    adj[(adj == 0)] = np.nan
    connectome = html_connectome._get_connectome(adj, coord)
    con_x = decode(connectome['_con_x'], '<f4')
    assert (con_x == expected_x).all()
    assert ((connectome['cmin'], connectome['cmax']) == ((- 2.5), 2.5))
def test_get_connectome():
    (adj, coord) = _make_connectome()
    connectome = html_connectome._get_connectome(adj, coord)
    con_x = decode(connectome['_con_x'], '<f4')
    expected_x = np.asarray([0, 0, 0, 0, 20, 0, 10, 10, 0, 10, 30, 0, 20, 0, 0, 20, 20, 0, 20, 40, 0, 30, 10, 0, 30, 30, 0, 40, 20, 0, 40, 40, 0], dtype='<f4')
    assert (con_x == expected_x).all()
    assert {'_con_x', '_con_y', '_con_z', '_con_w', 'colorscale'}.issubset(connectome.keys())
    assert ((connectome['cmin'], connectome['cmax']) == ((- 2.5), 2.5))
    adj[(adj == 0)] = np.nan
    connectome = html_connectome._get_connectome(adj, coord)
    con_x = decode(connectome['_con_x'], '<f4')
    assert (con_x == expected_x).all()
    assert ((connectome['cmin'], connectome['cmax']) == ((- 2.5), 2.5))