-
Notifications
You must be signed in to change notification settings - Fork 26
Failure for ipyparallel loading #32
Comments
Are you using ipyparallel with remote workers or all on the same machine? If they're remote, I doubt the import will work. If they're local ... I'm not sure what happens. Suffice to say you're probably the first person to test the feature with ipyparallel. 👍 |
The workers I imported were local. |
How does load_notebook compute the module name? |
It takes the path to the notebook and passes it directly to the It looks like it might be loading fine considering a module reference comes back, but the code to evaluate the API cells in the notebook depends on an interactive shell instance, and I'm wondering if that behaves the same in the workers as it would in the main notebook kernel. Also, there's a few other bugs open here that we haven't had time to focus on with respect to loading problems (#8 , #25) that might also be coming into play. |
Using the import hook approach works, most likely because the module winds up in sys.module. Using load_notebook, it probably does not. In test.ipynb:
In another notebook:
|
This also works: import os
import ipyparallel as ipp rc = ipp.Client() from jupyter_cms.loader import load_notebook
test = load_notebook('./test.ipynb') %%px
from jupyter_cms.loader import load_notebook
test = load_notebook('./test.ipynb') rc[:].map_async(test.squared, range(5)).get() The output from the I don't think we can expect |
sync_imports has extremely limited scope: it's an import hook, so anything that "creates" modules rather than simply importing them will probably not work. |
I'll write up the long-hand approach somewhere in the README and close this out. |
Thanks!! |
Is there any scheduled implentation of getting this module to work with ipyparallel? I have tried to import notebooks through the 'load_notebook' method but it fails.
I have created a notebook called 'simple_test.ipynb' with a single cell:
The way I import the notebook is as follows:
When trying to use the 'squared' fct, I get an error:
rc[:].map_async(simple.sq,range(5)).get()
Am I doing something wrong or is this a general issue?
The text was updated successfully, but these errors were encountered: