pathsim.utils.portreference module

class pathsim.utils.portreference.PortReference(block=None, ports=[0])[source]

Bases: object

This is a container class that holds a reference to a block and a list of ports.

Note

The default port, when no ports are defined in the arguments is 0.

Parameters:
  • block (Block) – internal block reference

  • ports (list[int]) – list of port indices

set(values)[source]

Sets the input ports of the reference block with values.

Note

If more values then ports, zip automatically stops iteration after all ports. If more ports then values, itertools.cycle is used to fill all the ports repeatedly.

Parameters:

values (list[obj], list[float]) – values to set at block input ports

get()[source]

Returns the values of the output ports of the reference block.

Returns:

out – values from block output ports

Return type:

list[obj], list[float]

to_dict()[source]

Serialization into dict