Register local and vectorize functions with contexts#346
Conversation
|
This PR is not ready yet -- still getting master merged in, which is proving stubborn... |
Makes Python3 happy.
There was a problem hiding this comment.
This arg and kwarg logic is duplicated below. So maybe it should be a method on DecoratorBase.
There was a problem hiding this comment.
These are the functions that are pushed to the engines, so it wouldn't make sense to have them as methods on DecoratorBase. I'd like to remove the duplication, but there isn't a clean way of doing so at the moment.
|
What is the status on this @kwmsmith ? |
|
Can you describe the API you are aiming for here? And the problems we are trying to fix? The discussions about this are a little hazy to me now. IIRC the problem with the decorators was that the function they decorated would not be pushed to the engines until run time. So we could not call the decorated functions in ways where the decorated function would be seen at compile time? If that makes sense. I'm trying to dig up the problem in old issues. |
|
Closing this PR -- will redo based on top of the |
Based on our experience thus far, it is better to make explicit the context that a localized or vectorized function belongs to.
This PR adds two
Contextmethods,localize()andvectorize(). These take a standalone function and add it to the context's namespace.Other improvements:
_execute(), replaced with a call toapply_async().