finam.Input#
- class finam.Input(name, info=None, static=False, **info_kwargs)[source]#
-
Default input implementation.
- Attributes:
has_source
Flag if this input instance has a source.
info
Info: The input’s data info.
is_static
Whether the input is static
logger
Logger for this component.
logger_name
Logger name derived from base logger name and class name.
name
Input name.
needs_pull
bool: if the input needs pull.
needs_push
bool: if the input needs push.
source
Get the input’s source output or adapter
uses_base_logger_name
Whether this class has a
base_logger_name
attribute.
Methods
exchange_info
([info])Exchange the data info with the input's source.
ping
()Pings upstream to inform outputs about the number of connected inputs.
pull_data
(time[, target])Retrieve the data from the input's source.
source_updated
(time)Informs the input that a new output is available.
- property name#
Input name.
- property is_static#
Whether the input is static
- property source#
Get the input’s source output or adapter
- Returns:
The input’s source.
- Return type:
- source_updated(time)[source]#
Informs the input that a new output is available.
- Parameters:
time (
datetime
) – Simulation time of the notification.
- pull_data(time, target=None)[source]#
Retrieve the data from the input’s source.
- Parameters:
time (
datetime
) – Simulation time to get the data for.target (
IInput
or None) – Requesting end point of this pull. Should beNone
for normal input pulls in components. Simple adapters should forward the source inAdapter._get_data()
. Push-based adapters should useself
inAdapter._source_updated()
.
- Returns:
Data set for the given simulation time.
- Return type:
- ping()[source]#
Pings upstream to inform outputs about the number of connected inputs.
Must be called after linking and before the connect phase.
- property has_source#
Flag if this input instance has a source.
- property logger_name#
Logger name derived from base logger name and class name.
- property uses_base_logger_name#
Whether this class has a
base_logger_name
attribute. True.
- property logger#
Logger for this component.