ftag.transform#
Classes#
Module Contents#
- class ftag.transform.Transform#
- variable_map: dict[str, dict[str, str]] | None = None#
- ints_map: dict[str, dict[str, dict[int, int]]] | None = None#
- floats_map: dict[str, dict[str, str | Callable]] | None = None#
- __post_init__()#
- __call__(batch: Batch) Batch #
- map_variables(batch: Batch) Batch #
Rename variables in a batch of data.
- Parameters:
batch (Batch) – Dict of structured numpy arrays.
- Returns:
Dict of structured numpy arrays with renamed variables.
- Return type:
Batch
- map_ints(batch: Batch) Batch #
Map integer values to new values.
- Parameters:
batch (Batch) – Dict of structured numpy arrays.
- Returns:
Dict of structured numpy arrays with mapped integer values.
- Return type:
Batch
- map_floats(batch: Batch) Batch #
Transform float values.
- Parameters:
batch (Batch) – Dict of structured numpy arrays.
- Returns:
Dict of structured numpy arrays with transformed float values.
- Return type:
Batch
- map_dtype(name: str, dtype: numpy.dtype) numpy.dtype #
- map_variable_names(name: str, variables: list[str], inverse=False) list[str] #