[ENH] t-SNE: Load openTSNE lazily#3883
Conversation
|
@markotoplak please check. |
|
@pavlin-policar, works well. I am back to 1 second. Thanks! |
| import openTSNE | ||
| import openTSNE.affinity | ||
| import openTSNE.initialization | ||
| if "openTSNE" in sys.modules: |
There was a problem hiding this comment.
@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.
Description of changes
Fixes #3523.
Load openTSNE (and, in turn, numba) as a lazy module.
Includes