-
Notifications
You must be signed in to change notification settings - Fork 9
Turn process classes into callables (unit-testing) #50
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
Just a quick thought:
def f(a):
a += 1
return a has an |
Yes, I haven't considered all cases (e.g., on-demand and/or group variables) yet in my proposition above, but for I should also note here that the generated callables are not intended to be added as processes in a model (we could just use the process classes for that). As we discussed in #49, programmatically convert any callable to a process class (i.e., |
Closed in #63. |
From discussion in #49, one big limitation of using classes to define model processes is that these are not easy to test.
One solution to this issue would be to programmatically create a callable from a process class. This should be relatively easy to implement.
For example, considering this process class
there would be a
xs.process_to_func
helpersuch that
my_process
is a callable equivalent toRegarding the implementation details,
my_process
would actually correspond to a callable class that encapsulates:MyProcess
MyProcess
)We could also programmatically add the docstrings of
my_process
.The text was updated successfully, but these errors were encountered: