Fis tests for new stricter scipy lil_matrix format
@@ -202,8 +202,8 @@ def test_smooth_knn_dist_l1norms_w_connectivity(nn_data):
# ------------------------------
def setup_search_graph(knn_dists, knn_indices, train):
search_graph = sparse.lil_matrix((train.shape[0], train.shape[0]), dtype=np.int8)
- search_graph.rows = knn_indices
- search_graph.data = (knn_dists != 0).astype(np.int8)
+ search_graph.rows[:] = [inds.tolist() for inds in knn_indices]
+ search_graph.data[:] = [vals.tolist() for vals in (knn_dists != 0).astype(np.int8)]
search_graph = search_graph.maximum(search_graph.transpose()).tocsr()
return search_graph
