Skip to content

Settings

Threads

num_threads

num_threads() -> int

The number of threads zeki evaluates on: by default, one per logical processor.

set_num_threads

set_num_threads(n: int) -> None

Set the number of threads zeki evaluates on, n >= 1. Call it before the first evaluation: the thread pool is set up once per process, and raises RuntimeError if it already has been.

The result cache

cache_info

cache_info() -> dict[str, int]

The result cache's entries, bytes, limit, hits and misses.

set_cache_limit

set_cache_limit(bytes: int) -> None

Set the result cache's limit in bytes (0 turns caching off).

clear_cache

clear_cache() -> None

Empty the result cache and reset its counters.

Timings

timings

timings() -> dict[str, float]

The seconds zeki has spent on each activity since the process started or reset_timings() was last called, each exclusive of the others: evaluate (the engine computing values), copula (applying copulas, including evaluating their targets), export (copying values out to numpy and Python and converting them to Polars) and import (copying values in from numpy). Everything else - building lazy operations, and the caller's own code - isn't included.

timing_counts

timing_counts() -> dict[str, int]

How many times zeki has started each activity, as for timings().

reset_timings

reset_timings() -> None

Set every activity's time and count back to zero.