Skip to content

Commit

Permalink
allow for graphs without knn_max set, closes #180
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgigante committed Jan 15, 2020
1 parent 82edb3e commit f52f13a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/magic/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,14 @@ def fit(self, X, graph=None):
graph = None
else:
self.knn = graph.knn
self.knn_max = graph.knn_max
self.alpha = graph.decay
self.n_pca = graph.n_pca
self.knn_dist = graph.distance
try:
self.knn_max = graph.knn_max
except AttributeError:
# not all graphs have knn_max
self.knn_max = None

self.X = X

Expand Down

0 comments on commit f52f13a

Please sign in to comment.