finam.Input#

class finam.Input(name, info=None, static=False, **info_kwargs)[source]#

Bases: IInput, Loggable

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 info#

The input’s data info.

Type:

Info

property needs_pull#

if the input needs pull.

Type:

bool

property needs_push#

if the input needs push.

Type:

bool

property source#

Get the input’s source output or adapter

Returns:

The input’s source.

Return type:

IOutput

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 be None for normal input pulls in components. Simple adapters should forward the source in Adapter._get_data(). Push-based adapters should use self in Adapter._source_updated().

Returns:

Data set for the given simulation time.

Return type:

pint.Quantity

ping()[source]#

Pings upstream to inform outputs about the number of connected inputs.

Must be called after linking and before the connect phase.

exchange_info(info=None)[source]#

Exchange the data info with the input’s source.

Parameters:

info (Info) – request parameters

Returns:

delivered parameters

Return type:

dict

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.