Skip to content

[ENH] t-SNE: Load openTSNE lazily#3883

Merged
janezd merged 1 commit intobiolab:masterfrom
pavlin-policar:lazy-load-tsne
Jun 14, 2019
Merged

[ENH] t-SNE: Load openTSNE lazily#3883
janezd merged 1 commit intobiolab:masterfrom
pavlin-policar:lazy-load-tsne

Conversation

@pavlin-policar
Copy link
Collaborator

Description of changes

Fixes #3523.

Load openTSNE (and, in turn, numba) as a lazy module.

Includes
  • Code changes
  • Tests
  • Documentation

@pavlin-policar
Copy link
Collaborator Author

@markotoplak please check.

@markotoplak
Copy link
Member

@pavlin-policar, works well. I am back to 1 second. Thanks!

import openTSNE
import openTSNE.affinity
import openTSNE.initialization
if "openTSNE" in sys.modules:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pavlin-policar, I'm trying to revive this, but since the change caused a crash on travis in bioinformatics, it is difficult to debug.

Lookin for a cause, I found this condition very strange. When you import a module, it always appears in sys.modules, doesn't it? Why did you need this line, what did it try to prevent, what was the case when the condition was false?

Have you by any chance tried adding global openTSNE to the function?

Is it possible that bioinformatics tried to do something in parallel and this function was executed in parallel (though I don't see how this could have happened), and numba initialized twice? Qt, for instance, does (or used to) crash if you initialized QApplication twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Orange.projection loads slowly after introduction of fastTSNE

3 participants