Skip to content

Exposing Workflow._graph.nodes_iter() through the public API #998

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

Closed
ischwabacher opened this issue Nov 18, 2014 · 1 comment
Closed

Exposing Workflow._graph.nodes_iter() through the public API #998

ischwabacher opened this issue Nov 18, 2014 · 1 comment

Comments

@ischwabacher
Copy link
Contributor

Maybe I'm doing this the wrong way, but I have a hierarchical workflow that needs to connect some boilerplate fields (dimension and terminal_output, in this case) from the input node to all of the nodes in the workflow that expect these inputs. I could obtain the list of nodes to iterate over with map(workflow.get_node, workflow.list_node_names()), but because this flattens the graph, it would only be possible at the top level and would prevent me from using the same trick on my sub-workflows (because the inputs would collide). The list of nodes that I actually want to connect to is precisely workflow._graph.nodes(), and philosophically I would like the ability to consider sub-workflows as black boxes, which I currently can't figure out how to do using the public API.

I understand not wanting to expose Workflow._graph directly, but is there a reason not to expose an iterator over the graph's nodes?

@ischwabacher ischwabacher changed the title Why isn't Workflow._graph.nodes_iter exposed through the public API? Exposing Workflow._graph.nodes_iter() through the public API Nov 19, 2014
@ischwabacher
Copy link
Contributor Author

After playing with this some more, it looks like the reason for this is that sub-workflows aren't black boxes. Closing in favor of #819.

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

No branches or pull requests

1 participant