hyped.core.ops package

Submodules

Module contents

Implementation Core Operations.

hyped.core.ops.cast(typ: Any, val: Any) Any

Cast a feature to a specified data type.

This function performs a type cast for a value if it is an instance of a Feature. It infers the target data type from the provided type annotation, adds a cast node to the data flow graph, and retrieves the resulting feature.

Parameters:
  • typ (Any) – The target type to cast the value to. Typically, this is a type annotation.

  • val (Any) – The value to be cast. If the value is not a Feature, it is returned unchanged.

Returns:

The cast value. If the input val is a Feature, the function returns the feature resulting from the cast operation. Otherwise, it returns val unchanged.

Return type:

Any

hyped.core.ops.filter_(value: T, condition: BoolFeature | bool | list[bool] | BooleanScalar | BooleanArray) T[source]

Filters input values based on a boolean condition using the GlobalFilter augmentor.

Parameters:
  • value (T) – The input values to filter.

  • condition (Bool) – A boolean array indicating which elements to retain.

Returns:

The filtered values that satisfy the given condition.

Return type:

T

hyped.core.ops.zip_(*args: SequenceFeature[T] | list[T] | list[list[T]] | ListScalar | ListArray) SequenceFeature[SequenceFeature[T] | list[T] | list[list[T]] | ListScalar | ListArray] | list[SequenceFeature[T] | list[T] | list[list[T]] | ListScalar | ListArray] | list[list[SequenceFeature[T] | list[T] | list[list[T]] | ListScalar | ListArray]] | ListScalar | ListArray[source]
hyped.core.ops.zip_(**kwargs: SequenceFeature[T] | list[T] | list[list[T]] | ListScalar | ListArray) SequenceFeature[_MappingFeature] | list[_MappingFeature] | list[list[_MappingFeature]] | ListScalar | ListArray

Zip multiple sequences together.

Parameters:
  • *args (Sequence) – Sequences to zip together. Must all have the same Value type.

  • **kwargs (Sequence) – Sequences to zip together. Can have mixed value types.

Returns:

The zipped sequences. If the input is

a list of sequences the output will be a Sequence[Sequence] too. If the input is a dict of mixed-type sequences, the output will be a Sequence[Mapping].

Return type:

Sequence[Sequence] | Sequence[Mapping]