Expand description
Utilities for timeframe operations and timestamp generation
This module provides utilities for working with timeframes, generating aligned timestamps, and converting between timeframes.
Functions§
- align_
timestamp - Align a timestamp to the start of a timeframe bucket
- alignment_
ratio - Calculate the alignment ratio between two timeframes
- count_
rows - Count the number of rows between two timestamps for a given timeframe
- find_
closest_ index - Find the closest index in a sorted array of timestamps Returns the index of the timestamp closest to the target
- find_
common_ timeframe - Find the common timeframe that both can align to (the finer one)
- find_
covering_ index - Find the index in source timestamps that covers the target timestamp Uses binary search for efficiency
- generate_
timestamps - Generate a series of aligned timestamps for a given timeframe
- generate_
timestamps_ micros - Generate timestamps as i64 microseconds for SIMD operations
- is_
timeframe_ compatible - Check if one timeframe is compatible with another (can be evenly divided)
- parse_
timeframe_ string - Parse a timeframe string (e.g., “1m”, “1h”, “1d”)
- timeframe_
to_ duration - Convert a timeframe to a Duration
- timeframe_
to_ minutes - Get the numeric value of a timeframe in minutes