holoscan.conditions
This module provides a Python API to underlying C++ API Conditions.
<a href="#holoscan.conditions.BooleanCondition">holoscan.conditions.BooleanCondition</a> |
Boolean condition class. |
<a href="#holoscan.conditions.CountCondition">holoscan.conditions.CountCondition</a> |
Count condition class. |
<a href="#holoscan.conditions.DownstreamMessageAffordableCondition">holoscan.conditions.DownstreamMessageAffordableCondition</a> |
Condition that permits execution when the downstream operator can accept new messages. |
<a href="#holoscan.conditions.MessageAvailableCondition">holoscan.conditions.MessageAvailableCondition</a> |
Condition that permits execution when an upstream message is available. |
<a href="#holoscan.conditions.PeriodicCondition">holoscan.conditions.PeriodicCondition</a> |
Condition class to support periodic execution of operators. |
- class holoscan.conditions.BooleanCondition
Bases:
<a href="holoscan_python_api_gxf.html#holoscan.gxf.GXFCondition">holoscan.gxf._gxf.GXFCondition</a>
Boolean condition class.
Used to control whether an entity is executed.
Attributes
<a href="#holoscan.conditions.BooleanCondition.args">args</a>
The list of arguments associated with the component. <a href="#holoscan.conditions.BooleanCondition.description">description</a>
YAML formatted string describing the condition. <a href="#holoscan.conditions.BooleanCondition.fragment">fragment</a>
Fragment that the condition belongs to. <a href="#holoscan.conditions.BooleanCondition.gxf_cid">gxf_cid</a>
The GXF component ID. <a href="#holoscan.conditions.BooleanCondition.gxf_cname">gxf_cname</a>
The name of the component. <a href="#holoscan.conditions.BooleanCondition.gxf_context">gxf_context</a>
The GXF context of the component. <a href="#holoscan.conditions.BooleanCondition.gxf_eid">gxf_eid</a>
The GXF entity ID. <a href="#holoscan.conditions.BooleanCondition.gxf_typename">gxf_typename</a>
The GXF type name of the condition. <a href="#holoscan.conditions.BooleanCondition.id">id</a>
The identifier of the component. <a href="#holoscan.conditions.BooleanCondition.name">name</a>
The name of the condition. spec Methods
<a href="#holoscan.conditions.BooleanCondition.add_arg">add_arg</a>
(*args, **kwargs)Overloaded function. <a href="#holoscan.conditions.BooleanCondition.check_tick_enabled">check_tick_enabled</a>
(self)Check whether the condition is True
.<a href="#holoscan.conditions.BooleanCondition.disable_tick">disable_tick</a>
(self)Set condition to False
.<a href="#holoscan.conditions.BooleanCondition.enable_tick">enable_tick</a>
(self)Set condition to True
.<a href="#holoscan.conditions.BooleanCondition.gxf_initialize">gxf_initialize</a>
(self)Initialize the component. <a href="#holoscan.conditions.BooleanCondition.initialize">initialize</a>
(self)Initialize the component. <a href="#holoscan.conditions.BooleanCondition.setup">setup</a>
(self, spec)Define the component specification. - __init__(self: holoscan.conditions._conditions.BooleanCondition, fragment: holoscan.core._core.Fragment, enable_tick: bool = True, name: str = 'noname_boolean_condition') → None
Boolean condition.
- Parameters
- fragmentholoscan.core.Fragment
- enable_tickbool, optional
- namestr, optional
The fragment the condition will be associated with
Boolean value for the condition.
The name of the condition.
- add_arg(*args, **kwargs)
add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None
add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None
Overloaded function.
Add an argument to the component.
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
.- property description
YAML formatted string describing the condition.
- 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
- specholoscan.core.ComponentSpec
Component specification associated with the condition.
- property spec
- class holoscan.conditions.CountCondition
Bases:
<a href="holoscan_python_api_gxf.html#holoscan.gxf.GXFCondition">holoscan.gxf._gxf.GXFCondition</a>
Count condition class.
Attributes
<a href="#holoscan.conditions.CountCondition.args">args</a>
The list of arguments associated with the component. <a href="#holoscan.conditions.CountCondition.count">count</a>
The execution count associated with the condition <a href="#holoscan.conditions.CountCondition.description">description</a>
YAML formatted string describing the condition. <a href="#holoscan.conditions.CountCondition.fragment">fragment</a>
Fragment that the condition belongs to. <a href="#holoscan.conditions.CountCondition.gxf_cid">gxf_cid</a>
The GXF component ID. <a href="#holoscan.conditions.CountCondition.gxf_cname">gxf_cname</a>
The name of the component. <a href="#holoscan.conditions.CountCondition.gxf_context">gxf_context</a>
The GXF context of the component. <a href="#holoscan.conditions.CountCondition.gxf_eid">gxf_eid</a>
The GXF entity ID. <a href="#holoscan.conditions.CountCondition.gxf_typename">gxf_typename</a>
The GXF type name of the condition. <a href="#holoscan.conditions.CountCondition.id">id</a>
The identifier of the component. <a href="#holoscan.conditions.CountCondition.name">name</a>
The name of the condition. spec Methods
<a href="#holoscan.conditions.CountCondition.add_arg">add_arg</a>
(*args, **kwargs)Overloaded function. <a href="#holoscan.conditions.CountCondition.gxf_initialize">gxf_initialize</a>
(self)Initialize the component. <a href="#holoscan.conditions.CountCondition.initialize">initialize</a>
(self)Initialize the component. <a href="#holoscan.conditions.CountCondition.setup">setup</a>
(self, arg0)Define the component specification. - __init__(self: holoscan.conditions._conditions.CountCondition, fragment: holoscan.core._core.Fragment, count: int = 1, name: str = 'noname_count_condition') → None
Count condition.
- Parameters
- fragmentholoscan.core.Fragment
- countint
- namestr, optional
The fragment the condition will be associated with
The execution count value used by the condition.
The name of the condition.
- add_arg(*args, **kwargs)
add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None
add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None
Overloaded function.
Add an argument to the component.
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 description
YAML formatted string describing 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
- specholoscan.core.ComponentSpec
Component specification associated with the condition.
- property spec
- class holoscan.conditions.DownstreamMessageAffordableCondition
Bases:
<a href="holoscan_python_api_gxf.html#holoscan.gxf.GXFCondition">holoscan.gxf._gxf.GXFCondition</a>
Condition that permits execution when the downstream operator can accept new messages.
Attributes
<a href="#holoscan.conditions.DownstreamMessageAffordableCondition.args">args</a>
The list of arguments associated with the component. <a href="#holoscan.conditions.DownstreamMessageAffordableCondition.description">description</a>
YAML formatted string describing the condition. <a href="#holoscan.conditions.DownstreamMessageAffordableCondition.fragment">fragment</a>
Fragment that the condition belongs to. <a href="#holoscan.conditions.DownstreamMessageAffordableCondition.gxf_cid">gxf_cid</a>
The GXF component ID. <a href="#holoscan.conditions.DownstreamMessageAffordableCondition.gxf_cname">gxf_cname</a>
The name of the component. <a href="#holoscan.conditions.DownstreamMessageAffordableCondition.gxf_context">gxf_context</a>
The GXF context of the component. <a href="#holoscan.conditions.DownstreamMessageAffordableCondition.gxf_eid">gxf_eid</a>
The GXF entity ID. <a href="#holoscan.conditions.DownstreamMessageAffordableCondition.gxf_typename">gxf_typename</a>
The GXF type name of the condition. <a href="#holoscan.conditions.DownstreamMessageAffordableCondition.id">id</a>
The identifier of the component. <a href="#holoscan.conditions.DownstreamMessageAffordableCondition.min_size">min_size</a>
The minimum number of free slots required for the downstream entity's back buffer. <a href="#holoscan.conditions.DownstreamMessageAffordableCondition.name">name</a>
The name of the condition. <a href="#holoscan.conditions.DownstreamMessageAffordableCondition.transmitter">transmitter</a>
The transmitter associated with the condition. spec Methods
<a href="#holoscan.conditions.DownstreamMessageAffordableCondition.add_arg">add_arg</a>
(*args, **kwargs)Overloaded function. <a href="#holoscan.conditions.DownstreamMessageAffordableCondition.gxf_initialize">gxf_initialize</a>
(self)Initialize the component. <a href="#holoscan.conditions.DownstreamMessageAffordableCondition.initialize">initialize</a>
(self)Initialize the condition <a href="#holoscan.conditions.DownstreamMessageAffordableCondition.setup">setup</a>
(self, spec)Define the component specification. - __init__(self: holoscan.conditions._conditions.DownstreamMessageAffordableCondition, fragment: holoscan.core._core.Fragment, min_size: int = 1, name: str = 'noname_downstream_affordable_condition') → None
Condition that permits execution when the downstream operator can accept new messages.
- Parameters
- fragmentholoscan.core.Fragment
- min_sizeint
- namestr, optional
The fragment the condition will be associated with
The minimum number of free slots present in the back buffer.
The name of the condition.
- add_arg(*args, **kwargs)
add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None
add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None
Overloaded function.
Add an argument to the component.
Add a list of arguments to the component.
- property args
The list of arguments associated with the component.
- Returns
- arglistholoscan.core.ArgList
- property description
YAML formatted string describing 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.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
- specholoscan.core.ComponentSpec
Component specification associated with the condition.
- property spec
- property transmitter
The transmitter associated with the condition.
- class holoscan.conditions.MessageAvailableCondition
Bases:
<a href="holoscan_python_api_gxf.html#holoscan.gxf.GXFCondition">holoscan.gxf._gxf.GXFCondition</a>
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
<a href="#holoscan.conditions.MessageAvailableCondition.args">args</a>
The list of arguments associated with the component. <a href="#holoscan.conditions.MessageAvailableCondition.description">description</a>
YAML formatted string describing the condition. <a href="#holoscan.conditions.MessageAvailableCondition.fragment">fragment</a>
Fragment that the condition belongs to. <a href="#holoscan.conditions.MessageAvailableCondition.front_stage_max_size">front_stage_max_size</a>
Threshold for the number of front stage messages. <a href="#holoscan.conditions.MessageAvailableCondition.gxf_cid">gxf_cid</a>
The GXF component ID. <a href="#holoscan.conditions.MessageAvailableCondition.gxf_cname">gxf_cname</a>
The name of the component. <a href="#holoscan.conditions.MessageAvailableCondition.gxf_context">gxf_context</a>
The GXF context of the component. <a href="#holoscan.conditions.MessageAvailableCondition.gxf_eid">gxf_eid</a>
The GXF entity ID. <a href="#holoscan.conditions.MessageAvailableCondition.gxf_typename">gxf_typename</a>
The GXF type name of the condition. <a href="#holoscan.conditions.MessageAvailableCondition.id">id</a>
The identifier of the component. <a href="#holoscan.conditions.MessageAvailableCondition.min_size">min_size</a>
The total number of messages over a set of input channels needed to permit execution. <a href="#holoscan.conditions.MessageAvailableCondition.name">name</a>
The name of the condition. <a href="#holoscan.conditions.MessageAvailableCondition.receiver">receiver</a>
The receiver associated with the condition. spec Methods
<a href="#holoscan.conditions.MessageAvailableCondition.add_arg">add_arg</a>
(*args, **kwargs)Overloaded function. <a href="#holoscan.conditions.MessageAvailableCondition.gxf_initialize">gxf_initialize</a>
(self)Initialize the component. <a href="#holoscan.conditions.MessageAvailableCondition.initialize">initialize</a>
(self)Initialize the condition <a href="#holoscan.conditions.MessageAvailableCondition.setup">setup</a>
(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 = 'noname_message_available_condition') → None
Condition that permits execution when an upstream message is available.
- Parameters
- fragmentholoscan.core.Fragment
- min_sizeint
- front_stage_max_sizeint
- namestr, optional
The fragment the condition will be associated with
The total number of messages over a set of input channels needed to permit execution.
Threshold for the number of front stage messages. Execution is only allowed if the number of front stage messages does not exceed this count.
The name of the condition.
- add_arg(*args, **kwargs)
add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None
add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None
Overloaded function.
Add an argument to the component.
Add a list of arguments to the component.
- property args
The list of arguments associated with the component.
- Returns
- arglistholoscan.core.ArgList
- property description
YAML formatted string describing the condition.
- 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
- specholoscan.core.ComponentSpec
Component specification associated with the condition.
- property spec
- class holoscan.conditions.PeriodicCondition
Bases:
<a href="holoscan_python_api_gxf.html#holoscan.gxf.GXFCondition">holoscan.gxf._gxf.GXFCondition</a>
Condition class to support periodic execution of operators. The recess (pause) period indicates the minimum amount of time that must elapse before the compute() method can be executed again. The recess period can be specified as an integer value in nanoseconds.
For example: 1000 for 1 microsecond 1000000 for 1 millisecond, and 10000000000 for 1 second.
The recess (pause) period can also be specified as a datetime.timedelta object representing a duration. (see https://docs.python.org/3/library/datetime.html#timedelta-objects)
For example: datetime.timedelta(minutes=1), datetime.timedelta(seconds=1), datetime.timedelta(milliseconds=1) and datetime.timedelta(microseconds=1). Supported argument names are: weeks| days | hours | minutes | seconds | millisecons | microseconds This requires import datetime.
Attributes
<a href="#holoscan.conditions.PeriodicCondition.args">args</a>
The list of arguments associated with the component. <a href="#holoscan.conditions.PeriodicCondition.description">description</a>
YAML formatted string describing the condition. <a href="#holoscan.conditions.PeriodicCondition.fragment">fragment</a>
Fragment that the condition belongs to. <a href="#holoscan.conditions.PeriodicCondition.gxf_cid">gxf_cid</a>
The GXF component ID. <a href="#holoscan.conditions.PeriodicCondition.gxf_cname">gxf_cname</a>
The name of the component. <a href="#holoscan.conditions.PeriodicCondition.gxf_context">gxf_context</a>
The GXF context of the component. <a href="#holoscan.conditions.PeriodicCondition.gxf_eid">gxf_eid</a>
The GXF entity ID. <a href="#holoscan.conditions.PeriodicCondition.gxf_typename">gxf_typename</a>
The GXF type name of the condition. <a href="#holoscan.conditions.PeriodicCondition.id">id</a>
The identifier of the component. <a href="#holoscan.conditions.PeriodicCondition.name">name</a>
The name of the condition. spec Methods
<a href="#holoscan.conditions.PeriodicCondition.add_arg">add_arg</a>
(*args, **kwargs)Overloaded function. <a href="#holoscan.conditions.PeriodicCondition.gxf_initialize">gxf_initialize</a>
(self)Initialize the component. <a href="#holoscan.conditions.PeriodicCondition.initialize">initialize</a>
(self)Initialize the component. <a href="#holoscan.conditions.PeriodicCondition.last_run_timestamp">last_run_timestamp</a>
(self)Gets the integer representing the last run time stamp. <a href="#holoscan.conditions.PeriodicCondition.recess_period">recess_period</a>
(*args, **kwargs)Overloaded function. <a href="#holoscan.conditions.PeriodicCondition.recess_period_ns">recess_period_ns</a>
(self)Gets the recess (pause) period value in nanoseconds. <a href="#holoscan.conditions.PeriodicCondition.setup">setup</a>
(self, arg0)Define the component specification. - __init__(*args, **kwargs)
Overloaded function.
__init__(self: holoscan.conditions._conditions.PeriodicCondition, fragment: holoscan.core._core.Fragment, recess_period: int, name: str = ‘noname_periodic_condition’) -> None
__init__(self: holoscan.conditions._conditions.PeriodicCondition, fragment: holoscan.core._core.Fragment, recess_period: datetime.timedelta, name: str = ‘noname_periodic_condition’) -> None
Condition class to support periodic execution of operators.
- Parameters
- fragmentholoscan.core.Fragment
- recess_periodint or datetime.timedelta
- namestr, optional
The fragment the condition will be associated with
The recess (pause) period value used by the condition. If an integer is provided, the units are in nanoseconds.
The name of the condition.
- add_arg(*args, **kwargs)
add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None
add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None
Overloaded function.
Add an argument to the component.
Add a list of arguments to the component.
- property args
The list of arguments associated with the component.
- Returns
- arglistholoscan.core.ArgList
- property description
YAML formatted string describing 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.
- last_run_timestamp(self: holoscan.conditions._conditions.PeriodicCondition) → int
Gets the integer representing the last run time stamp.
- property name
The name of the condition.
- Returns
- namestr
- recess_period(*args, **kwargs)
recess_period(self: holoscan.conditions._conditions.PeriodicCondition, arg0: int) -> None
recess_period(self: holoscan.conditions._conditions.PeriodicCondition, arg0: datetime.timedelta) -> None
Overloaded function.
Sets the recess (pause) period associated with the condition. The recess period can be specified as an integer value in nanoseconds or a datetime.timedelta object representing a duration.
Sets the recess (pause) period associated with the condition. The recess period can be specified as an integer value in nanoseconds or a datetime.timedelta object representing a duration.
- recess_period_ns(self: holoscan.conditions._conditions.PeriodicCondition) → int
Gets the recess (pause) period value in nanoseconds.
- setup(self: holoscan.conditions._conditions.PeriodicCondition, arg0: holoscan.core._core.ComponentSpec) → None
Define the component specification.
- Parameters
- specholoscan.core.ComponentSpec
Component specification associated with the condition.
- property spec