Cube Types¶
- class floe.api.cubes.ComputeCube(name: Optional[str] = None, title: Optional[str] = None, uuid: Optional[str] = None, **parameters: floe.api.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: Optional[str] = None, title: Optional[str] = None, uuid: Optional[str] = None, **parameters: floe.api.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, floe.api.parameters.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: floe.api.parameters.BaseParameter, **fields: Union[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: floe.api.parameters.ParameterGroup, **fields: Union[int, str, List[floe.api.parameters.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: Optional[str] = None, cubes: Optional[List[floe.api.cubes.Cube]] = 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: Optional[floe.api.cubes.Cube] = None, size: int = 0, next_cube: Optional[floe.api.cubes.Cube] = 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: Optional[str] = None, title: Optional[str] = None, uuid: Optional[str] = None, **parameters: floe.api.parameters.BaseParameter)¶
- class floe.api.cubes.ParallelCubeGroup(name: Optional[str] = None, cubes: Optional[List[floe.api.cubes.Cube]] = 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: floe.api.cubes.Cube, from_parameter: floe.api.parameters.BaseParameter, to_cube: floe.api.cubes.Cube, to_parameter: floe.api.parameters.BaseParameter)¶
Represents a parameter connection between stages
- class floe.api.cubes.SinkCube(name: Optional[str] = None, title: Optional[str] = None, uuid: Optional[str] = None, **parameters: floe.api.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: Optional[str] = None, title: Optional[str] = None, uuid: Optional[str] = None, **parameters: floe.api.parameters.BaseParameter)¶
A cube that inputs data into the floe