Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

FIx Parallel Magics for newparallel #341

Closed
minrk opened this Issue · 8 comments

3 participants

@minrk
Owner

The parallel magics did work with the new code, but I didn't touch the magic, as they were still for IPython.kernel. Now that IPython.kernel is out of the way, I should give the parallelmagic an update, to make it better match newparallel.

Also, %autopx is now broken, I believe due to the recent AST merge. %autopx hijacked run_source, but as far as I can tell, that's never called anymore.

@takluyver
Owner
@fperez
Owner
@minrk
Owner

Thanks, I think I've figured it out enough for interactive use. However, it doesn't work from inside %run or irunner.

If I have a script containing:

%autopx
a=5
%autopx

%autopx should hijack execution until %autopx is called again, but this doesn't happen. I believe this is because the whole file gets run inside a single run_cell. Is there not a way to hijack individual lines anymore?

It looks like hijacking run_code is my only option, but I'm pretty sure I need the source, not the code objects.

This is a general issue. I expect there are several behaviors no longer consistent between %run/irunner and interactive execution, when manipulating the ipython object.

@takluyver
Owner
@minrk
Owner

If they are pickleable, then I think I should be fine. Of course, it also requires that I can execute code that would raise NameErrors locally.

@takluyver
Owner
@minrk minrk was assigned
@minrk
Owner

Splitting run_ast_nodes so that it calls run_code for each node, rather than for the whole set, seems to fix much of the issue. Then, all I need to do is override run_code, and it works.

See here:
minrk@ipython:master...minrk:parallelmagic#diff-0

@minrk
Owner

closed by e68cf3a

@minrk minrk closed this
@damianavila damianavila referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.