Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:KrishnaswamyLab/graphtools into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleyjs committed Jun 7, 2018
2 parents 96018b5 + 5b21471 commit 7422c97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion graphtools/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def Graph(data,
elif len(parent_classes) == 2:
class Graph(parent_classes[0], parent_classes[1]):
pass
elif len(parent_classes) == 2:
elif len(parent_classes) == 3:
class Graph(parent_classes[0], parent_classes[1], parent_classes[2]):
pass
else:
Expand Down
14 changes: 1 addition & 13 deletions graphtools/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,7 @@ def build_kernel(self):
symmetric matrix with ones down the diagonal
with no non-negative entries.
"""
if self.decay is None or self.thresh == 1:
# binary connectivity matrix
# sklearn has a function for this
log_start("KNN search")
K = kneighbors_graph(self.knn_tree,
n_neighbors=self.knn,
metric=self.distance,
mode='connectivity',
include_self=True)
log_complete("KNN search")
else:
# sparse fast alpha decay
K = self.build_kernel_to_data(self.data_nu)
K = self.build_kernel_to_data(self.data_nu)
# symmetrize
K = (K + K.T) / 2
return K
Expand Down

0 comments on commit 7422c97

Please sign in to comment.