-
Notifications
You must be signed in to change notification settings - Fork 15
chore: refactor handling of the actual dataflow #464
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
base: transition-to-runkit
Are you sure you want to change the base?
Conversation
This is preparation work to prepare a change in how the actual dataflow graph manages its internal data. The objective of this commit is to make an interface that hides these details to the rest of Syskit
75f8fa1 to
42d7f4c
Compare
| .edge_info(source_task.orocos_task, orocos_task) | ||
| .key?([source_port, sink_port]) | ||
| Runtime::ActualDataFlow.ports_connected?( | ||
| source_task.orocos_task, source_port, orocos_task, sink_port |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see from where orocos_task is from. Neither in this refactor or in the old code
| # @param [Orocos::TaskContext] sink_task | ||
| # @return [{[String,String] => Hash}] mapping of (source_port,sink_port) pairs | ||
| # to the policy of the established connection | ||
| def connections_of_tasks(source_task, sink_task) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this isn't a heterogeneous graph, I would go with just def connections(source_task, sink_task)
| # @return [{[Orocos::Task,Orocos::Task] => Array<[String,String]>}] matching | ||
| # connections, as a mapping of (source_task, sink_task) to the port | ||
| # pair (as names) | ||
| def input_connections_of_ports(orocos_task, port_names) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def inputs_for(orocos_task, port_names)
| # @return [{[Orocos::Task,Orocos::Task] => Array<[String,String]>}] matching | ||
| # connections, as a mapping of (source_task, sink_task) to the port | ||
| # pair (as names) | ||
| def output_connections_of_task(orocos_task) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def outputs_of(orocos_task)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the reason of these '_of_task' and 'of_ports'
The input_connections is of_ports, that is is restricted to some ports.
This gives all outputs of a given task. There's actually output_connections_of_ports that restricts to ports. I think not specifying it on all methods would be confusing.
| def input_connections_of_ports(orocos_task, port_names) | ||
| @graph.each_in_neighbour(orocos_task) | ||
| .with_object({}) do |source_t, result| | ||
| mappings = @graph.edge_info(source_t, orocos_task) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At static_input_port_connections you called the return of @graph_edge_info connections, I like it better than mappings which I think is innocuous
connections = @graph.edge_info(source_t, orocos_task)
This PR's objective is to cleanup the ActualDataFlow graph so that it's easier to change. One main change is that the graph is now not directly available anymore, as it was, so that the rest of the runtime code is not directly dependent on the graph structure.