Skip to content

Conversation

@doudou
Copy link
Member

@doudou doudou commented Feb 21, 2025

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.

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
@doudou doudou requested a review from jhonasiv February 21, 2025 00:29
@doudou doudou requested a review from wvmcastro February 28, 2025 14:59
@doudou doudou force-pushed the transition-to-runkit branch from 75f8fa1 to 42d7f4c Compare April 4, 2025 16:17
.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

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)

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)

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)

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)

Copy link
Member Author

@doudou doudou Apr 24, 2025

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)

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)

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

Successfully merging this pull request may close these issues.

4 participants