Skip to content

Utilities

Source: src/utils.rs

Internal Functions

These are internal Rust functions not directly callable from Python.

cast_column

Cast a column in-place to the given DataType, returning a new DataFrame.

validate_column_exists

Validate that a required column exists in the DataFrame.

get_groups

Groups a DataFrame by "unique_id" and aggregates the "y" column into lists. Returns a DataFrame with columns: unique_id (String), y (List).

df_to_hashmap

Optimized conversion of a grouped DataFrame into a HashMap mapping id -> Vec.

get_groups_multivariate

Groups a DataFrame by "unique_id" and aggregates all dimension columns into lists.

df_to_hashmap_multivariate

Converts a grouped DataFrame into a HashMap mapping unique_id -> multivariate time series.

compute_pairwise

Generic pairwise computation for univariate distance functions.

Handles: column validation, casting, grouping, HashMap construction, Arc wrapping, parallel pairwise iteration with deduplication, output assembly.

compute_pairwise_multivariate

Generic pairwise computation for multivariate distance functions.

build_output_df

Build the output DataFrame from pairwise results, casting IDs back to original dtypes.