ipython-cluster-helper icon indicating copy to clipboard operation
ipython-cluster-helper copied to clipboard

Calling cluster_view from within another python file

Open GarrettBeatty opened this issue 8 years ago • 0 comments

If I have the following code:

def run():
    with cluster_view(scheduler=None, queue=None, num_jobs=5, direct=True,
                    extra_params={"run_local": True}) as view:
        a = 1
        view.push({'a':a})
        test = view.map(some_function, range(20))

When I call run from within another Python file I get an error.. NameError: name 'a' is not defined. This code will work if I just call run() within the same file.

GarrettBeatty avatar Mar 11 '17 16:03 GarrettBeatty