finam.IComponent#

class finam.IComponent[source]#

Bases: ABC

Interface for components.

Attributes:
inputs

IOList: The component’s inputs.

metadata

The component’s meta data.

name

Component name.

outputs

IOList: The component’s outputs.

status

The component’s current status.

Methods

connect(start_time)

Connect exchange data and metadata with linked components.

finalize()

Finalize and clean up the component.

initialize()

Initialize the component.

update()

Update the component by one time step.

validate()

Validate the correctness of the component's settings and coupling.

abstract initialize()[source]#

Initialize the component.

After the method call, the component’s inputs and outputs must be available, and the component should have status ComponentStatus.INITIALIZED.

abstract connect(start_time)[source]#

Connect exchange data and metadata with linked components.

The method can be called multiple times if there are failed pull attempts.

After each method call, the component should have status ComponentStatus.CONNECTED if connecting was completed, ComponentStatus.CONNECTING if some but not all required initial input(s) could be pulled, and ComponentStatus.CONNECTING_IDLE if nothing could be pulled.

Parameters:

start_time (datetime) – The composition’s starting time. Can be before the component’s actual time.

abstract validate()[source]#

Validate the correctness of the component’s settings and coupling.

After the method call, the component should have status ComponentStatus.VALIDATED.

abstract update()[source]#

Update the component by one time step. Push new values to outputs.

After the method call, the component should have status ComponentStatus.UPDATED or ComponentStatus.FINISHED.

abstract finalize()[source]#

Finalize and clean up the component.

After the method call, the component should have status ComponentStatus.FINALIZED.

abstract property name#

Component name.

abstract property inputs#

The component’s inputs.

Type:

IOList

abstract property outputs#

The component’s outputs.

Type:

IOList

abstract property status#

The component’s current status.

abstract property metadata#

The component’s meta data. Will only be called after the connect phase of the composition.