holoscan.graphs

This module provides a Python API for the C++ API Graph classes.

holoscan.graphs.FlowGraph

alias of holoscan.graphs._graphs.OperatorFlowGraph

holoscan.graphs.FragmentFlowGraph

Directed acyclic graph (DAG) class.

holoscan.graphs.OperatorFlowGraph

Directed acyclic graph (DAG) class.

holoscan.graphs.FlowGraph

alias of holoscan.graphs._graphs.OperatorFlowGraph

class holoscan.graphs.FragmentFlowGraph

Bases: holoscan.graphs._graphs.FragmentGraph

Directed acyclic graph (DAG) class.

Attributes

context

The graph's context (as an opaque PyCapsule object)

Methods

add_node(self, node)

Add the node to the graph.

get_next_nodes(self, arg0)

Get the nodes immediately downstream of a given node.

get_nodes(self)

Get all nodes.

get_port_map(self, arg0, arg1)

get_previous_nodes(self, arg0)

Get the nodes immediately upstream of a given node.

get_root_nodes(self)

Get all root nodes.

is_leaf(self, node)

Check if the node is a leaf node.

is_root(self, node)

Check if the node is a root node.

__init__(self: holoscan.graphs._graphs.FragmentFlowGraph) → None

Directed acyclic graph (DAG) class.

add_node(self: holoscan.graphs._graphs.FragmentFlowGraph, node: holoscan::Fragment) → None

Add the node to the graph.

Parameters
nodeholoscan.core.Operator | holoscan.core.Fragment

The node to add.

property context

The graph’s context (as an opaque PyCapsule object)

get_next_nodes(self: holoscan.graphs._graphs.FragmentFlowGraph, arg0: holoscan::Fragment) → vector_of_node_type

Get the nodes immediately downstream of a given node.

Parameters
nodeholoscan.core.Operator | holoscan.core.Fragment

A node in the graph.

Returns
list of Operator or Fragment

A list containing the downstream nodes.

get_nodes(self: holoscan.graphs._graphs.FragmentFlowGraph) → vector_of_node_type

Get all nodes.

The nodes are returned in the order they were added to the graph.

Returns
list of Operator or Fragment

A list containing all nodes.

get_port_map(self: holoscan.graphs._graphs.FragmentFlowGraph, arg0: holoscan::Fragment, arg1: holoscan::Fragment) → dict

get_previous_nodes(self: holoscan.graphs._graphs.FragmentFlowGraph, arg0: holoscan::Fragment) → vector_of_node_type

Get the nodes immediately upstream of a given node.

Parameters
nodeholoscan.core.Operator | holoscan.core.Fragment

A node in the graph.

Returns
list of Operator or Fragment

A list containing the upstream nodes.

get_root_nodes(self: holoscan.graphs._graphs.FragmentFlowGraph) → vector_of_node_type

Get all root nodes.

Returns
list of Operator or Fragment

A list containing all root nodes.

is_leaf(self: holoscan.graphs._graphs.FragmentFlowGraph, node: holoscan::Fragment) → bool

Check if the node is a leaf node.

Parameters
nodeholoscan.core.Operator | holoscan.core.Fragment

A node in the graph.

Returns
bool

Whether the node is a leaf node

is_root(self: holoscan.graphs._graphs.FragmentFlowGraph, node: holoscan::Fragment) → bool

Check if the node is a root node.

Parameters
nodeholoscan.core.Operator | holoscan.core.Fragment

A node in the graph.

Returns
bool

Whether the node is a root node

class holoscan.graphs.OperatorFlowGraph

Bases: holoscan.graphs._graphs.OperatorGraph

Directed acyclic graph (DAG) class.

Attributes

context

The graph's context (as an opaque PyCapsule object)

Methods

add_node(self, node)

Add the node to the graph.

get_next_nodes(self, arg0)

Get the nodes immediately downstream of a given node.

get_nodes(self)

Get all nodes.

get_port_map(self, arg0, arg1)

get_previous_nodes(self, arg0)

Get the nodes immediately upstream of a given node.

get_root_nodes(self)

Get all root nodes.

is_leaf(self, node)

Check if the node is a leaf node.

is_root(self, node)

Check if the node is a root node.

__init__(self: holoscan.graphs._graphs.OperatorFlowGraph) → None

Directed acyclic graph (DAG) class.

add_node(self: holoscan.graphs._graphs.OperatorFlowGraph, node: holoscan::Operator) → None

Add the node to the graph.

Parameters
nodeholoscan.core.Operator | holoscan.core.Fragment

The node to add.

property context

The graph’s context (as an opaque PyCapsule object)

get_next_nodes(self: holoscan.graphs._graphs.OperatorFlowGraph, arg0: holoscan::Operator) → vector_of_node_type

Get the nodes immediately downstream of a given node.

Parameters
nodeholoscan.core.Operator | holoscan.core.Fragment

A node in the graph.

Returns
list of Operator or Fragment

A list containing the downstream nodes.

get_nodes(self: holoscan.graphs._graphs.OperatorFlowGraph) → vector_of_node_type

Get all nodes.

The nodes are returned in the order they were added to the graph.

Returns
list of Operator or Fragment

A list containing all nodes.

get_port_map(self: holoscan.graphs._graphs.OperatorFlowGraph, arg0: holoscan::Operator, arg1: holoscan::Operator) → dict

get_previous_nodes(self: holoscan.graphs._graphs.OperatorFlowGraph, arg0: holoscan::Operator) → vector_of_node_type

Get the nodes immediately upstream of a given node.

Parameters
nodeholoscan.core.Operator | holoscan.core.Fragment

A node in the graph.

Returns
list of Operator or Fragment

A list containing the upstream nodes.

get_root_nodes(self: holoscan.graphs._graphs.OperatorFlowGraph) → vector_of_node_type

Get all root nodes.

Returns
list of Operator or Fragment

A list containing all root nodes.

is_leaf(self: holoscan.graphs._graphs.OperatorFlowGraph, node: holoscan::Operator) → bool

Check if the node is a leaf node.

Parameters
nodeholoscan.core.Operator | holoscan.core.Fragment

A node in the graph.

Returns
bool

Whether the node is a leaf node

is_root(self: holoscan.graphs._graphs.OperatorFlowGraph, node: holoscan::Operator) → bool

Check if the node is a root node.

Parameters
nodeholoscan.core.Operator | holoscan.core.Fragment

A node in the graph.

Returns
bool

Whether the node is a root node

© Copyright 2022-2023, NVIDIA. Last updated on Sep 13, 2023.