finam.IInput#

class finam.IInput[source]#

Bases: ABC

Interface for input slots.

Attributes:
info

Info: The input’s data info.

is_static

Whether the input is static

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

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.

abstract property name#

Input name.

abstract property is_static#

Whether the input is static

abstract property info#

The input’s data info.

Type:

Info

abstract property needs_pull#

if the input needs pull.

Type:

bool

abstract property needs_push#

if the input needs push.

Type:

bool

abstract property source#

Get the input’s source output or adapter

Returns:

The input’s source.

Return type:

IOutput

abstract source_updated(time)[source]#

Informs the input that a new output is available.

Parameters:

time (datetime) – Simulation time of the notification.

abstract pull_data(time, target)[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.

Returns:

Data set for the given simulation time.

Return type:

pint.Quantity

abstract ping()[source]#

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

Must be called after linking and before the connect phase.

abstract exchange_info(info)[source]#

Exchange the data info with the input’s source.

Parameters:

info (Info) – request parameters

Returns:

delivered parameters

Return type:

dict