finam.IOutput#
- class finam.IOutput[source]#
Bases:
ABCInterface for output slots.
- Attributes:
infoInfo: The output’s data info.
is_staticWhether the output is static
memory_limitThe memory limit for this slot
memory_locationThe memory-mapping location for this slot
nameOutput name.
needs_pullbool: if the output needs pull.
needs_pushbool: if the output needs push.
targetsGet target inputs and adapters for this output.
timeThe output’s time of the latest available data
Methods
add_target(target)Add a target input or adapter for this output.
chain(other)Chain outputs and adapters.
finalize()Finalize the output
get_data(time, target)Get the output's data-set for the given time.
get_info(info)Exchange and get the output's data info.
has_info()Returns if the output has a data info.
notify_targets(time)Notify all targets by calling their
source_updated(time)method.pinged(source)Called when receiving a ping from a downstream input.
push_data(data, time)Push data into the output.
push_info(info)Push data info into the output.
- abstract property name#
Output name.
- abstract property time#
The output’s time of the latest available data
- abstract property is_static#
Whether the output is static
- abstract property info#
The output’s data info.
- Raises:
FinamNoDataError – Raises the error if infos were not yet exchanged
- Type:
- abstract property memory_limit#
The memory limit for this slot
- abstract property memory_location#
The memory-mapping location for this slot
- abstractmethod has_info()[source]#
Returns if the output has a data info.
The info is not required to be validly exchanged.
- abstractmethod add_target(target)[source]#
Add a target input or adapter for this output.
- Parameters:
target (
IInput) – The target to add.
- abstract property targets#
Get target inputs and adapters for this output.
- Returns:
List of targets.
- Return type:
- abstractmethod pinged(source)[source]#
Called when receiving a ping from a downstream input.
- Parameters:
source (
IInput) – Pinging target end point
- abstractmethod push_data(data, time)[source]#
Push data into the output.
Should notify targets, and can handle the provided date.
- Parameters:
data (array_like) – Data set to push.
time (
datetime) – Simulation time of the data set.
- abstractmethod push_info(info)[source]#
Push data info into the output.
- Parameters:
info (
Info) – Delivered data info
- abstractmethod notify_targets(time)[source]#
Notify all targets by calling their
source_updated(time)method.- Parameters:
time (
datetime) – Simulation time of the simulation.
- abstractmethod get_data(time, target)[source]#
Get the output’s data-set for the given time.
- Parameters:
- Returns:
data-set for the requested time.
- Return type:
- Raises:
FinamNoDataError – Raises the error if no data is available
- abstractmethod get_info(info)[source]#
Exchange and get the output’s data info.
- Parameters:
info (
Info) – Requested data info- Returns:
Delivered data info
- Return type:
- Raises:
FinamNoDataError – Raises the error if no info is available