holoscan.conditions

Clara Holoscan v0.4.0

This module provides a Python API to underlying C++ API Conditions.

holoscan.conditions.BooleanCondition

Boolean condition class.

holoscan.conditions.CountCondition

Count condition class.

holoscan.conditions.DownstreamMessageAffordableCondition

Condition that permits execution when the downstream operator can accept new messages.

holoscan.conditions.MessageAvailableCondition

Condition that permits execution when an upstream message is available.

class holoscan.conditions.BooleanCondition

Bases: holoscan.gxf._gxf.GXFCondition

Boolean condition class.

Used to control whether an entity is executed.

Attributes

args

The list of arguments associated with the component.

fragment

Fragment that the condition belongs to.

gxf_cid

The GXF component ID.

gxf_cname

The name of the component.

gxf_context

The GXF context of the component.

gxf_eid

The GXF entity ID.

gxf_typename

The GXF type name of the condition.

id

The identifier of the component.

name

The name of the condition.

Methods

add_arg(*args, **kwargs)

Overloaded function.

check_tick_enabled(self)

Check whether the condition is True.

disable_tick(self)

Set condition to False.

enable_tick(self)

Set condition to True.

gxf_initialize(self)

Initialize the component.

initialize(self)

Initialize the component.

setup(self, spec)

Define the component specification.

__init__(self: holoscan.conditions._conditions.BooleanCondition, fragment: holoscan.core._core.Fragment, enable_tick: bool = True, name: str = 'boolean_condition') → None

Boolean condition.

Parameters
fragmentFragment

The fragment the condition will be associated with

enable_tickbool, optional

Boolean value for the condition.

namestr, optional

The name of the condition.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

check_tick_enabled(self: holoscan.conditions._conditions.BooleanCondition) → bool

Check whether the condition is True.

disable_tick(self: holoscan.conditions._conditions.BooleanCondition) → None

Set condition to False.

enable_tick(self: holoscan.conditions._conditions.BooleanCondition) → None

Set condition to True.

property fragment

Fragment that the condition belongs to.

Returns
nameholoscan.core.Fragment

property gxf_cid

The GXF component ID.

property gxf_cname

The name of the component.

property gxf_context

The GXF context of the component.

property gxf_eid

The GXF entity ID.

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

Initialize the component.

property gxf_typename

The GXF type name of the condition.

Returns
str

The GXF type name of the condition

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.gxf._gxf.GXFCondition) → None

Initialize the component.

property name

The name of the condition.

Returns
namestr

setup(self: holoscan.conditions._conditions.BooleanCondition, spec: holoscan.core._core.ComponentSpec) → None

Define the component specification.

Parameters
specComponentSpec

Component specification associated with the condition.

class holoscan.conditions.CountCondition

Bases: holoscan.gxf._gxf.GXFCondition

Count condition class.

Attributes

args

The list of arguments associated with the component.

count

The execution count associated with the condition

fragment

Fragment that the condition belongs to.

gxf_cid

The GXF component ID.

gxf_cname

The name of the component.

gxf_context

The GXF context of the component.

gxf_eid

The GXF entity ID.

gxf_typename

The GXF type name of the condition.

id

The identifier of the component.

name

The name of the condition.

Methods

add_arg(*args, **kwargs)

Overloaded function.

gxf_initialize(self)

Initialize the component.

initialize(self)

Initialize the component.

setup(self, arg0)

Define the component specification.

__init__(self: holoscan.conditions._conditions.CountCondition, fragment: holoscan.core._core.Fragment, count: int = 1, name: str = 'count_condition') → None

Count condition.

Parameters
fragmentFragment

The fragment the condition will be associated with

countint

The execution count value used by the condition.

namestr, optional

The name of the condition.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

property count

The execution count associated with the condition

property fragment

Fragment that the condition belongs to.

Returns
nameholoscan.core.Fragment

property gxf_cid

The GXF component ID.

property gxf_cname

The name of the component.

property gxf_context

The GXF context of the component.

property gxf_eid

The GXF entity ID.

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

Initialize the component.

property gxf_typename

The GXF type name of the condition.

Returns
str

The GXF type name of the condition

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.gxf._gxf.GXFCondition) → None

Initialize the component.

property name

The name of the condition.

Returns
namestr

setup(self: holoscan.conditions._conditions.CountCondition, arg0: holoscan.core._core.ComponentSpec) → None

Define the component specification.

Parameters
specComponentSpec

Component specification associated with the condition.

class holoscan.conditions.DownstreamMessageAffordableCondition

Bases: holoscan.gxf._gxf.GXFCondition

Condition that permits execution when the downstream operator can accept new messages.

Attributes

args

The list of arguments associated with the component.

fragment

Fragment that the condition belongs to.

gxf_cid

The GXF component ID.

gxf_cname

The name of the component.

gxf_context

The GXF context of the component.

gxf_eid

The GXF entity ID.

gxf_typename

The GXF type name of the condition.

id

The identifier of the component.

min_size

The minimum number of free slots required for the downstream entity's back buffer.

name

The name of the condition.

transmitter

The transmitter associated with the condition.

Methods

add_arg(*args, **kwargs)

Overloaded function.

gxf_initialize(self)

Initialize the component.

initialize(self)

Initialize the condition

setup(self, spec)

Define the component specification.

__init__(self: holoscan.conditions._conditions.DownstreamMessageAffordableCondition, fragment: holoscan.core._core.Fragment, min_size: int = 1, name: str = 'downstream_message_affordable_condition') → None

Condition that permits execution when the downstream operator can accept new messages.

Parameters
fragmentFragment

The fragment the condition will be associated with

min_sizeint

The minimum number of free slots present in the back buffer.

namestr, optional

The name of the condition.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

property fragment

Fragment that the condition belongs to.

Returns
nameholoscan.core.Fragment

property gxf_cid

The GXF component ID.

property gxf_cname

The name of the component.

property gxf_context

The GXF context of the component.

property gxf_eid

The GXF entity ID.

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

Initialize the component.

property gxf_typename

The GXF type name of the condition.

Returns
str

The GXF type name of the condition

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.conditions._conditions.DownstreamMessageAffordableCondition) → None

Initialize the condition

This method is called only once when the condition is created for the first time, and uses a light-weight initialization.

property min_size

The minimum number of free slots required for the downstream entity’s back buffer.

property name

The name of the condition.

Returns
namestr

setup(self: holoscan.conditions._conditions.DownstreamMessageAffordableCondition, spec: holoscan.core._core.ComponentSpec) → None

Define the component specification.

Parameters
specComponentSpec

Component specification associated with the condition.

property transmitter

The transmitter associated with the condition.

class holoscan.conditions.MessageAvailableCondition

Bases: holoscan.gxf._gxf.GXFCondition

Condition that permits execution when an upstream message is available.

Executed when the associated receiver queue has at least a certain number of elements. The receiver is specified using the receiver parameter of the scheduling term. The minimum number of messages that permits the execution of the entity is specified by min_size. An optional parameter for this scheduling term is front_stage_max_size, the maximum front stage message count. If this parameter is set, the scheduling term will only allow execution if the number of messages in the queue does not exceed this count. It can be used for operators which do not consume all messages from the queue.

Attributes

args

The list of arguments associated with the component.

fragment

Fragment that the condition belongs to.

front_stage_max_size

Threshold for the number of front stage messages.

gxf_cid

The GXF component ID.

gxf_cname

The name of the component.

gxf_context

The GXF context of the component.

gxf_eid

The GXF entity ID.

gxf_typename

The GXF type name of the condition.

id

The identifier of the component.

min_size

The total number of messages over a set of input channels needed to permit execution.

name

The name of the condition.

receiver

The receiver associated with the condition.

Methods

add_arg(*args, **kwargs)

Overloaded function.

gxf_initialize(self)

Initialize the component.

initialize(self)

Initialize the condition

setup(self, arg0)

Define the component specification.

__init__(self: holoscan.conditions._conditions.MessageAvailableCondition, fragment: holoscan.core._core.Fragment, min_size: int = 1, front_stage_max_size: int = 1, name: str = 'message_available_condition') → None

Condition that permits execution when an upstream message is available.

Parameters
fragmentFragment

The fragment the condition will be associated with

min_sizeint

The total number of messages over a set of input channels needed to permit execution.

front_stage_max_sizeint

Threshold for the number of front stage messages. Execution is only allowed if the number of front stage messages does not exceed this count.

namestr, optional

The name of the condition.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

property fragment

Fragment that the condition belongs to.

Returns
nameholoscan.core.Fragment

property front_stage_max_size

Threshold for the number of front stage messages. Execution is only allowed if the number of front stage messages does not exceed this count.

property gxf_cid

The GXF component ID.

property gxf_cname

The name of the component.

property gxf_context

The GXF context of the component.

property gxf_eid

The GXF entity ID.

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

Initialize the component.

property gxf_typename

The GXF type name of the condition.

Returns
str

The GXF type name of the condition

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.conditions._conditions.MessageAvailableCondition) → None

Initialize the condition

This method is called only once when the condition is created for the first time, and uses a light-weight initialization.

property min_size

The total number of messages over a set of input channels needed to permit execution.

property name

The name of the condition.

Returns
namestr

property receiver

The receiver associated with the condition.

setup(self: holoscan.conditions._conditions.MessageAvailableCondition, arg0: holoscan.core._core.ComponentSpec) → None

Define the component specification.

Parameters
specComponentSpec

Component specification associated with the condition.

© Copyright 2022, NVIDIA. Last updated on Jun 28, 2023.