-
Notifications
You must be signed in to change notification settings - Fork 1
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
Attach functions to nodes #67
Comments
So I think this is actually two issues bundled together
|
Actually, there might be a way for instance to have |
Thanks again @liamhuber for the pull functionality. I tested it for the list_potentials example in my lammps node. It works really well. In the present implementation, the list_potentials node is part of the workflow and will thus be executed when running the workflow. A side effect of this behavior is that the output of this node appears in the output of the macro, which is not the desired behavior. What I would like to have is a functionality similar to your 'show' button in ironflow, where the available functions are only executed when explicitly called. A possible way to define such node functions would be to replace
with
or maybe even with
The property
.attach
allows us to attach functions to a specific node. With this, we have the flexibility to define class-like nodes that have next to input and output multiple node-specific functions. I have also the feeling that it would be more intuitive to replacecreate
withadd
. This immediately symbolizes that the node is added to the workflow. It may be actually helpful to have also acreate
command that returns a standalone node, which is not attached to the workflow. Particularly when interactively working I missed such a feature a number of times. From the two alternatives given above, I would prefer the second (shorter) one, since it avoids having to specify the structure object twice (as generator and as function argument). The second version works also like the self-argument in a class and maybe thus more intuitive for Python users. However, its implementation may be more challenging.Having this functionality would allow us to realize very easily a behavior as you have with
show
in ironflow. There, I find it a really powerful and highly useful concept and having something likewould be extremely helpful.
The text was updated successfully, but these errors were encountered: