hyperstream.tool package

Submodules

hyperstream.tool.aggregate_tool module

class hyperstream.tool.aggregate_tool.AggregateTool(aggregation_meta_data, **kwargs)[source]

Bases: hyperstream.tool.tool.Tool

This type of tool aggregates over a given plate. For example, if the input is all the streams in a node on plate A.B, and the aggregation is over plate B, the results will live on plate A alone. This can also be thought of as marginalising one dimension of a tensor over the plates

hyperstream.tool.base_tool module

class hyperstream.tool.base_tool.BaseTool(**kwargs)[source]

Bases: hyperstream.utils.utils.Printable, hyperstream.utils.utils.Hashable

Base class for all tools

message(interval)[source]
name

hyperstream.tool.multi_output_tool module

class hyperstream.tool.multi_output_tool.MultiOutputTool(**kwargs)[source]

Bases: hyperstream.tool.base_tool.BaseTool

Special type of tool that outputs multiple streams on a new plate rather than a single stream. There are in this case multiple sinks rather than a single sink, and a single source rather than multiple sources. Note that no alignment stream is required here. Also note that we don’t subclass Tool due to different calling signatures

execute(source, splitting_stream, sinks, interval, input_plate_value, output_plate)[source]

Execute the tool over the given time interval.

Parameters:
  • source (Stream) – The source stream
  • splitting_stream – The stream over which to split
  • sinks (list[Stream] | tuple[Stream]) – The sink streams
  • interval (TimeInterval) – The time interval
  • input_plate_value (tuple[tuple[str, str]] | None) – The value of the plate where data comes from (can be None)
  • output_plate (Plate) – The plate where data is put onto
Returns:

None

hyperstream.tool.plate_creation_tool module

class hyperstream.tool.plate_creation_tool.PlateCreationTool(**kwargs)[source]

Bases: hyperstream.tool.base_tool.BaseTool

Special type of tool that creates a new plate. There is no sink in this case, as it does not yet exist. Note that no alignment stream is required here. Also note that we don’t subclass Tool due to different calling signatures

execute(source, interval, input_plate_value)[source]

Execute the tool over the given time interval.

Parameters:
  • source (Stream) – The source stream
  • interval (TimeInterval) – The time interval
  • input_plate_value (tuple[tuple[str, str]] | None) – The value of the plate where data comes from (can be None)
Returns:

None

hyperstream.tool.selector_tool module

class hyperstream.tool.selector_tool.SelectorTool(selector_meta_data, **kwargs)[source]

Bases: hyperstream.tool.base_tool.BaseTool

This type of tool performs sub-selection of streams within a node. This can either be done using a selector in the parameters or using an input stream. The sink node plate should be a sub-plate of the source node. Examples are IndexOf and SubArray, either with fixed or variable parameters

execute(sources, sinks, interval)[source]

Execute the tool over the given time interval.

Parameters:
  • sources (list[Stream] | tuple[Stream]) – The source streams
  • sinks (list[Stream] | tuple[Stream]) – The sink streams
  • interval (TimeInterval) – The time interval
Returns:

None

hyperstream.tool.tool module

class hyperstream.tool.tool.Tool(**kwargs)[source]

Bases: hyperstream.tool.base_tool.BaseTool

Base class for tools. Tools are the unit of computation, operating on input streams to produce an output stream

execute(sources, sink, alignment_stream, interval)[source]

Execute the tool over the given time interval. If an alignment stream is given, the output instances will be aligned to this stream

Parameters:
  • sources (list[Stream] | tuple[Stream] | None) – The source streams (possibly None)
  • sink (Stream) – The sink stream
  • alignment_stream (Stream | None) – The alignment stream
  • interval (TimeInterval) – The time interval
Returns:

None

Module contents

Tool package. Defines Tool, MultiOutputTool and SelectorTool base classes.