Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support non-modules in @require #3041

Merged
merged 6 commits into from
Apr 12, 2013
Merged

support non-modules in @require #3041

merged 6 commits into from
Apr 12, 2013

Conversation

minrk
Copy link
Member

@minrk minrk commented Mar 20, 2013

Functions and other objects can be passed, which implies a push when the function is passed to apply.

This relieves one of the most common complaints in IPython.parallel - allowing multi-function tasks without a push call for the intermediate functions.

def foo(a):
    return a*a

@parallel.require(foo)
def bar(b):
    return foo(b)

@parallel.require(bar)
def baz(c, d):
    return bar(c) - bar(d)

view.apply_sync(baz, 4, 5)

Pinging @ogrisel as the source of the idea at PyData.

Functions and other objects can be passed, which implies a push when the function is passed to apply.
@ogrisel
Copy link
Contributor

ogrisel commented Mar 20, 2013

It looks good to me. I would like to pull from your branch to give it a try but the Hyatt wifi is failing me...

so that additional post-processing can happen on uncanning
allows the dependency function to be called even before the real task arguments are unpacked.
@jankatins
Copy link
Contributor

related to #2489 ?

@minrk
Copy link
Member Author

minrk commented Apr 6, 2013

This is not really related to #2489, other than being an improvement in what objects can be sent and when.

@ellisonbg
Copy link
Member

I have ran the test suite locally under python 2.7 (passed), tried some examples in the notebook and looked through the code. Looks like a nice improvement. I am +1 on merging.

ellisonbg added a commit that referenced this pull request Apr 12, 2013
@ellisonbg ellisonbg merged commit 4be107e into ipython:master Apr 12, 2013
@minrk minrk deleted the requirepush branch March 31, 2014 23:36
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants