Skip to content

Architecture

Architecture #

Bases: Summarizable

callback_group_names: tuple[str, ...] property #

Get callback group names.

Returns:

Type Description
tuple[str, ...]

CallbackGroup names.

callback_groups: tuple[CallbackGroupStructValue, ...] property #

Get callback groups.

Returns:

Type Description
tuple[CallbackGroupStructValue, ...]

CallbackGroup struct value.

callbacks: tuple[CallbackStructValue, ...] property #

Get callbacks.

Returns:

Type Description
tuple[CallbackStructValue, ...]

Callbacks.

communications: tuple[CommunicationStructValue, ...] property #

Get communications.

Returns:

Type Description
tuple[CommunicationStructValue, ...]

Communication struct value.

executor_names: tuple[str, ...] property #

Get executor names.

Returns:

Type Description
tuple[str, ...]

Executor names.

executors: tuple[ExecutorStructValue, ...] property #

Get executors.

Returns:

Type Description
tuple[ExecutorStructValue, ...]

Executors.

node_names: tuple[str, ...] property #

Get node names.

Returns:

Type Description
tuple[str, ...]

Node names.

nodes: tuple[NodeStructValue, ...] property #

Get nodes.

Returns:

Type Description
tuple[NodeStructValue, ...]

Node struct value.

path_names: tuple[str, ...] property #

Get path names.

Returns:

Type Description
tuple[str, ...]

Path names.

paths: tuple[PathStructValue, ...] property #

Get paths.

Returns:

Type Description
tuple[PathStructValue, ...]

Path struct value.

publishers: tuple[PublisherStructValue, ...] property #

Get publishers.

Returns:

Type Description
tuple[PublisherStructValue, ...]

Publisher struct value.

services: tuple[ServiceStructValue, ...] property #

Get services.

Returns:

Type Description
tuple[ServiceStructValue, ...]

Service struct value.

subscriptions: tuple[SubscriptionStructValue, ...] property #

Get subscriptions.

Returns:

Type Description
tuple[SubscriptionStructValue, ...]

Subscription struct value.

summary: Summary property #

Get summary.

Returns:

Type Description
Summary

Summary about value objects and runtime data objects.

topic_names: tuple[str, ...] property #

Get topic names.

Returns:

Type Description
tuple[str, ...]

Topic names.

add_path(path_name, path_info) #

Add path.

Parameters:

Name Type Description Default
path_name str

Path name.

required
path_info PathStructValue

path information.

required

Raises:

Type Description
InvalidArgumentError

Occurs when path name were duplicate.

ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

combine_path(path_left, path_right) #

Combine path.

Parameters:

Name Type Description Default
path_left PathStructValue

Path left.

required
path_right PathStructValue

Path right.

required

Returns:

Name Type Description
PathStructValue PathStructValue

Path struct value of combined results.

diff_node_names(left_arch, right_arch) staticmethod #

Compare two architecture objects and return the difference of nodes name.

Parameters:

Name Type Description Default
left_arch Architecture

Architecture object

required
right_arch Architecture

Architecture object

required

Returns:

Type Description
tuple[tuple[str, ...], tuple[str, ...]]

Returns node names that exist only in the respective architectures.

diff_node_pubs(left_node, right_node) staticmethod #

Compare two nodes of architecture objects and return the difference of publish topic names.

Parameters:

Name Type Description Default
left_node NodeStructValue

Node in architecture

required
right_node NodeStructValue

Node in architecture

required

Returns:

Type Description
tuple[tuple[str, ...], tuple[str, ...]]

Returns publish topic names that exist only in the respective nodes.

diff_node_subs(left_node, right_node) staticmethod #

Compare two nodes of architecture objects and return the difference of subscribe topic names.

Parameters:

Name Type Description Default
left_node NodeStructValue

Node in architecture

required
right_node NodeStructValue

Node in architecture

required

Returns:

Type Description
tuple[tuple[str, ...], tuple[str, ...]]

Returns subscribe topic names that exist only in the respective nodes.

diff_topic_names(left_arch, right_arch) staticmethod #

Compare two architecture objects and return the difference of pub/sub topic names.

Parameters:

Name Type Description Default
left_arch Architecture

Architecture object

required
right_arch Architecture

Architecture object

required

Returns:

Type Description
tuple[tuple[str, ...], tuple[str, ...]]

Returns pub/sub topic names that exist only in the respective architectures.

export(file_path, force=False) #

Architecture export.

Parameters:

Name Type Description Default
file_path str

File path.

required
force bool

Forced specification, by default False. If True, a file with the same name will be overwritten if it exists.

False

get_callback(callback_name) #

Get callback.

Returns:

Type Description
CallbackStructValue

Callback struct value.

Raises:

Type Description
ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_callback_group(callback_group_name) #

Get callback group.

Returns:

Type Description
CallbackGroupStructValue

CallbackGroup struct value.

Raises:

Type Description
ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_communication(publisher_node_name, subscription_node_name, topic_name, *, publisher_construction_order=0, subscription_construction_order=0) #

Get communication.

Parameters:

Name Type Description Default
publisher_node_name str

Publisher node name.

required
subscription_node_name str

Subscription node name.

required
topic_name str

Topic name.

required
publisher_construction_order int

Publisher construction order.

0
subscription_construction_order int

Subscription construction order.

0

Returns:

Type Description
CommunicationStructValue

Communication struct value.

Raises:

Type Description
ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_executor(executor_name) #

Get executor.

Returns:

Type Description
ExecutorStructValue

Executor struct value.

Raises:

Type Description
ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_node(node_name) #

Get node.

Returns:

Type Description
NodeStructValue

Node struct value.

Raises:

Type Description
ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_path(path_name) #

Get path name.

Parameters:

Name Type Description Default
path_name str

Path name.

required

Returns:

Type Description
PathStructValue

Path struct value.

Raises:

Type Description
InvalidArgumentError

Occurs when path name were not exist.

ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

insert_publisher_callback(node_name, publish_topic_name, callback_name, publisher_construction_order) #

Insert association of callback with publisher in "node_name" node.

Parameters:

Name Type Description Default
node_name str

name of target node

required
publish_topic_name str

topic name of target publisher into which callback is inserted

required
callback_name str

name of callback to be inserted for publisher

required
publisher_construction_order int

construction order of target publisher

required

Raises:

Type Description
ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

insert_variable_passing(node_name, callback_name_write, callback_name_read) #

Insert variable_passing in "node_name" node.

Parameters:

Name Type Description Default
node_name str

name of target node

required
callback_name_write str

name of write callback to be inserted in variable_passing

required
callback_name_read str

name of read callback to be inserted in variable_passing

required

Raises:

Type Description
ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

remove_path(path_name) #

Remove path.

Parameters:

Name Type Description Default
path_name str

Path name.

required

Raises:

Type Description
InvalidArgumentError

Occurs when path name were not exist.

remove_publisher_callback(node_name, publish_topic_name, callback_name, publisher_construction_order) #

Remove association of callback with publisher in "node_name" node.

Parameters:

Name Type Description Default
node_name str

name of target node

required
publish_topic_name str

topic name of target publisher from which callback is removed

required
callback_name str

name of callback to be removed for publisher

required
publisher_construction_order int

construction order of target publisher

required

Raises:

Type Description
ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

remove_variable_passing(node_name, callback_name_write, callback_name_read) #

Remove variable_passing in "node_name" node.

Parameters:

Name Type Description Default
node_name str

name of target node

required
callback_name_write str

name of write callback to be removed from variable_passing

required
callback_name_read str

name of read callback to be removed from variable_passing

required

Raises:

Type Description
ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

rename_callback(src, dst) #

Update callback name from "src" to "dst" in architecture.

Parameters:

Name Type Description Default
src str

current callback name

required
dst str

updated callback name

required

Raises:

Type Description
ItemNotFoundError

Occurs when no items were found.

rename_executor(src, dst) #

Update executor name from "src" to "dst" in architecture.

Parameters:

Name Type Description Default
src str

current executor name

required
dst str

updated executor name

required

Raises:

Type Description
ItemNotFoundError

Occurs when no items were found.

rename_node(src, dst) #

Update node name from "src" to "dst" in architecture.

Parameters:

Name Type Description Default
src str

current node name

required
dst str

updated node name

required

rename_path(src, dst) #

Update path name from "src" to "dst" in architecture.

Parameters:

Name Type Description Default
src str

current path name

required
dst str

updated path name

required

Raises:

Type Description
ItemNotFoundError

Occurs when no items were found.

rename_topic(src, dst) #

Update topic name from "src" to "dst" in architecture.

Parameters:

Name Type Description Default
src str

current topic name

required
dst str

updated topic name

required

search_paths(*node_names, max_node_depth=None, node_filter=None, communication_filter=None) #

Search for paths between specified nodes.

Parameters:

Name Type Description Default
node_names str

Specifies the name of the node included in the path to search.

()
max_node_depth int | None

Max node depth.

None
node_filter Callable[[str], bool] | None

Node filter.

None
communication_filter Callable[[str], bool] | None

Communication filter.

None

Returns:

Type Description
list[PathStructValue]

Search result path struct value.

update_message_context(node_name, context_type, subscribe_topic_name, publish_topic_name) #

Update message_context of node_path in "node_name" node.

Parameters:

Name Type Description Default
node_name str

name of target node

required
context_type str

type name of message_context to be added

required
subscribe_topic_name str

name of subscribe topic of target node_path

required
publish_topic_name str

name of publish topic of target node_path

required

Raises:

Type Description
ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

update_path(path_name, path) #

Update path.

Parameters:

Name Type Description Default
path_name str

Path name.

required
path PathStructValue

Path struct value.

required

Raises:

Type Description
InvalidArgumentError

Occurs when path name were not exist.

ArchitectureReader #

Architecture reader base class.

get_callback_groups(node) abstractmethod #

Get callback group values.

Parameters:

Name Type Description Default
node NodeValue

target node

required

Returns:

Type Description
Sequence[CallbackGroupValue]

callback group values

get_executors() abstractmethod #

Get executor values.

Returns:

Type Description
Sequence[ExecutorValue]

executor values

get_message_contexts(node) abstractmethod #

Get message contexts.

Parameters:

Name Type Description Default
node NodeValue

target node

required

Returns:

Type Description
Sequence[dict]

message contexts

get_node_names_and_cb_symbols(callback_group_id) abstractmethod #

Get node names and callback symbols from callback group id.

Returns:

Type Description
Sequence[tuple[str | None, str | None]]

node names and callback symbols. tuple structure: (node_name, callback_symbol)

get_nodes() abstractmethod #

Get nodes.

Returns:

Type Description
Sequence[NodeValueWithId]

node values.

get_paths() abstractmethod #

Get path value.

Returns:

Type Description
Sequence[PathValue]

path values

get_publishers(node_info) abstractmethod #

Get publishers info.

Parameters:

Name Type Description Default
node_info NodeValue

target node

required

Returns:

Type Description
Sequence[PublisherValue]

publisher values

get_service_callbacks(node) abstractmethod #

Get service callback values.

Parameters:

Name Type Description Default
node NodeInfo

target node

required

Returns:

Type Description
Sequence[ServiceCallbackValue]

service callback values

get_services(node) abstractmethod #

Get service values.

Parameters:

Name Type Description Default
node NodeInfo

target node

required

Returns:

Type Description
Sequence[ServiceValue]

service values

get_subscription_callbacks(node) abstractmethod #

Get subscription callback values.

Parameters:

Name Type Description Default
node NodeValue

target node

required

Returns:

Type Description
Sequence[SubscriptionCallbackValue]

subscription callback values

get_subscriptions(node) abstractmethod #

Get subscription values.

Parameters:

Name Type Description Default
node NodeInfo

target node

required

Returns:

Type Description
Sequence[SubscriptionValue]

subscription values

get_timer_callbacks(node) abstractmethod #

Get timer callback values.

Parameters:

Name Type Description Default
node NodeValue

target node

required

Returns:

Type Description
Sequence[TimerCallbackValue]

timer callback values

get_timers(node) abstractmethod #

Get timers info.

Parameters:

Name Type Description Default
node NodeValue

target node

required

Returns:

Type Description
Sequence[TimerValue]

timers values

get_variable_passings(node) abstractmethod #

Get variable passing values.

Parameters:

Name Type Description Default
node NodeValue

target node

required

Returns:

Type Description
Sequence[VariablePassingvalue]

variable passing values