backtest_lib.universe.vector_mapping.VectorMapping#
- class backtest_lib.universe.vector_mapping.VectorMapping#
-
Mapping with vectorized arithmetic semantics.
Backends may rely on matching key order to perform fast vector operations. When key order differs between two mappings, operations remain correct but typically require reindexing and incur a performance cost.
- abstractmethod floor() VectorMapping[K, int]#
Return a mapping with values floored to integers.
- abstractmethod classmethod from_vectors(keys: Iterable[K_contra], values: Iterable[V_co]) Self#
Create a mapping from ordered key/value vectors.
- abstractmethod truncate() VectorMapping[K, int]#
Return a mapping with values truncated to integers.