-
Notifications
You must be signed in to change notification settings - Fork 58
Does not work with lambda functions #206
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
Comments
Hi @RafalSkolasinski, that is expected because the function needs to be pickled such that it can be send to the executor. Therefore, lambda functions will never work with the default edit: From v0.11 you are able to use lambda functions! |
That's a bummer. Any chance you could raise ValueError in such cases and produce a nice warning message? |
That makes sense, @jbweston, would you know how to best tackle this? |
Even better would be to find mechanism to make |
It's already possible with ipyparallel if you enable dill or cloudpickle. |
@RafalSkolasinski can you please provide the complete code sample? This likely depends on which runner you are using. |
@jbweston it is not obvious that this blocks the kernel, but it does hang forever and does not error. import adaptive
adaptive.notebook_extension()
ring2 = lambda xy: xy[0]**2 + xy[1]**2
learner = adaptive.Learner2D(ring2, bounds=[(-1, 1), (-1, 1)])
runner = adaptive.Runner(learner, goal=lambda l: l.npoints >= 1000)
runner.live_info() |
For example, if in the initial example one have
then execution just hangs.
The text was updated successfully, but these errors were encountered: