Skip to content

Commit

Permalink
fix transform after set_params
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgigante committed Jun 29, 2018
1 parent e9f3829 commit d1c281d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/magic/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,13 @@ def transform(self, X=None, genes=None, t_max=20,
pass

if self.graph is None:
raise NotFittedError("This MAGIC instance is not fitted yet. Call "
"'fit' with appropriate arguments before "
"using this method.")
if self.X is not None:
self.fit(self.X)
else:
raise NotFittedError(
"This MAGIC instance is not fitted yet. Call "
"'fit' with appropriate arguments before "
"using this method.")

store_result = True
if X is not None and not matrix_is_equivalent(X, self.X):
Expand Down

0 comments on commit d1c281d

Please sign in to comment.