python - Reload module on remote ipengine when using ipython -


hoping has straightforward answer missed reading of docs. following problem -

  1. i have module loaded on ipengine(s) on startup
  2. i've since made changes module
  3. i want these changes propagated remote ipengine(s) i.e. want module reloaded in remote instances

how can accomplished?

you can turn on ipython autoreload feature on engines following:

%px %load_ext autoreload %px %autoreload 2 

note solution, , calling reload dview.execute() both have problem when new engines can come online later (as when using batch scheduler on cluster): execute on engines present.

one other wrinkle: may want deep (recursive) reloading. see option ipengine:

--zmqinteractiveshell.deep_reload=<cbool> default: false enable deep (recursive) reloading default. ipython can use deep_reload module reloads changes in modules recursively (it replaces reload() function, don't need change use it). deep_reload() forces full reload of modules code may have changed, default reload() function not.  when deep_reload off, ipython use normal reload(), deep_reload still available dreload(). 

Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -