rics.performance.types#

Types used by the framework.

Module Attributes

DataType

A type of data accepted by candidate functions.

CandFunc

A function (DataType) -> Any under test.

ResultsDict

A result set on the form {candidate_label: {data_label: [runtime, ...]}}.

Ts

Argument types for a DataFunc callable.

DataFunc

A function (*Ts) -> DataType used to generate test data.

SetupFunc

A callable (data) -> data run -- unmeasured -- before each timed repetition to produce a fresh input.

StratifyFunc

A callable (data_label) -> stratum_key grouping comparable variants; see MultiCaseTimer.

StrataMapping

A precomputed grouping stratum_key -> data labels.

StratifyArg

Valid stratify input types; see MultiCaseTimer.compute_strata().

class DataType#

A type of data accepted by candidate functions.

alias of TypeVar(‘DataType’)

CandFunc#

A function (DataType) -> Any under test. The return value is ignored.

alias of Callable[[DataType], Any]

ResultsDict#

A result set on the form {candidate_label: {data_label: [runtime, ...]}}.

alias of dict[str, dict[Hashable, list[float]]]

Ts = Ts#

Argument types for a DataFunc callable.

DataFunc#

A function (*Ts) -> DataType used to generate test data.

alias of Callable[[Unpack[Ts]], DataType]

SetupFunc#

A callable (data) -> data run – unmeasured – before each timed repetition to produce a fresh input.

alias of Callable[[DataType], DataType]

StratifyFunc#

A callable (data_label) -> stratum_key grouping comparable variants; see MultiCaseTimer.

alias of Callable[[Hashable], Hashable]

StrataMapping#

A precomputed grouping stratum_key -> data labels. Any compatible mapping works; Strata is the fitted variant returned by MultiCaseTimer.compute_strata() (it also records how it was derived).

alias of Mapping[Any, Iterable[Hashable]]

StratifyArg: TypeAlias = collections.abc.Callable[[typing.Hashable], collections.abc.Hashable] | collections.abc.Mapping[typing.Any, collections.abc.Iterable[typing.Hashable]] | int | typing.Literal['full', 'auto'] | None#

Valid stratify input types; see MultiCaseTimer.compute_strata().