def test_sample_idx_wrong_length(): with assert_raises_message( ValueError, "sample_idx (10) must be the same length as data ({})".format( data.shape[0]), ): build_graph(data, graphtype="mnn", sample_idx=np.arange(10))
def test_sample_idx_and_precomputed(): build_graph( squareform(pdist(data)), n_pca=None, sample_idx=np.arange(10), precomputed="distance", decay=10, )
def test_sample_idx_and_precomputed(): with assert_raises_message( ValueError, "MNNGraph does not support precomputed values. Use `graphtype='exact'` and `sample_idx=None` or `precomputed=None`", ): build_graph(data, n_pca=None, sample_idx=np.arange(10), precomputed="distance")
def test_build_exact_with_sample_idx(): with assert_raises_message( ValueError, "TraditionalGraph does not support batch correction. Use `graphtype='mnn'` or `sample_idx=None`", ): build_graph(data, graphtype="exact", sample_idx=np.arange(len(data)), decay=10)
def test_sample_idx_wrong_length(): build_graph(data, graphtype="mnn", sample_idx=np.arange(10))
def test_sample_idx_and_precomputed(): build_graph(data, n_pca=None, sample_idx=np.arange(10), precomputed="distance")
def test_build_knn_with_sample_idx(): with assert_raises_message( ValueError, "kNNGraph does not support batch correction. Use `graphtype='mnn'` or `sample_idx=None`", ): build_graph(data, graphtype="knn", sample_idx=np.arange(len(data)))
def test_build_knn_with_sample_idx(): build_graph(data, graphtype='knn', sample_idx=np.arange(len(data)))
def test_build_exact_with_sample_idx(): build_graph(data, graphtype='exact', sample_idx=np.arange(len(data)), decay=10)