Cube Types

Copyright (C) 2023 Cadence Design Systems, Inc. (Cadence)

class floe.api.cubes.ComputeCube(name: str | None = None, title: str | None = None, uuid: str | None = None, **parameters: BaseParameter)

A compute cube

process(data, port)

To be implemented by a derived class, should process one item

class floe.api.cubes.Cube(name: str | None = None, title: str | None = None, uuid: str | None = None, **parameters: BaseParameter)

A base compute cube

begin()

Can be implemented in a derived class to initialize a cube

emit(data, port=None)

Calling emit on the cube will send the output item to every output port

end()

Can be implemented in a derived class to finalize a cube

get_parameter_group(name: str) Tuple[str, ParameterGroup]

Get a parameter group by name

input_ports() dict[str, InputPort]

Returns all of the input ports defined on this cube

modify_parameter(parameter: BaseParameter, **fields: bool | str | int | Any) None

Modify a cube’s parameter in the context of defining a floe.

WARNING: Never use this method on a standalone parameter or within a cube.

modify_parameter_group(group: ParameterGroup, **fields: int | str | List[BaseParameter]) None

Modify a cubes’s parameter group in the context of defining a floe.

neighbors()

Returns all of the downstream cubes of this cube

output_ports() dict[str, OutputPort]

Returns all of the output ports defined on this cube

parameter_groups() dict[str, ParameterGroup]

Returns all parameter groups

parameters() dict[str, BaseParameter]

Returns all of the parameters for a cube instance

wait_on(port)

Calling this function tells the runtime not to call process until data is received on the specified port

class floe.api.cubes.CubeGroup(name: str | None = None, cubes: List[Cube] | None = None)

A container for grouping cubes together

class floe.api.cubes.CubeParametersMixin

Provides all of the built in parameters for a Cube.

See ParallelMixin, which redefines all hardware_group parameters so it can override spot_policy.

class floe.api.cubes.CycleDetails(in_cycle: bool = False, cycle_head: Cube | None = None, size: int = 0, next_cube: Cube | None = None)

This object is container for the following information: 1. Whether the object is in a cycle 2. If it is in a cycle, a reference to the first node in the cycle. This information is necessary for deadlock detection in cyclic floes.

class floe.api.cubes.ParallelComputeCube(name: str | None = None, title: str | None = None, uuid: str | None = None, **parameters: BaseParameter)
class floe.api.cubes.ParallelCubeGroup(name: str | None = None, cubes: List[Cube] | None = None)
class floe.api.cubes.ParallelMixin

Provides additional built in parameters for a Parallel Cube.

See CubeParametersMixin, which first defines hardware_group. ParallelMixin must redefine all hardware_group parameters so it can override spot_policy.

class floe.api.cubes.ParameterConnection(from_cube: Cube, from_parameter: BaseParameter, to_cube: Cube, to_parameter: BaseParameter)

Represents a parameter connection between stages

class floe.api.cubes.SinkCube(name: str | None = None, title: str | None = None, uuid: str | None = None, **parameters: BaseParameter)

A cube that serves as output for the floe

write(data, port)

To be implemented in a derived class

class floe.api.cubes.SourceCube(name: str | None = None, title: str | None = None, uuid: str | None = None, **parameters: BaseParameter)

A cube that inputs data into the floe