riptable.Utils.common

Logic / helper functions used throughout the riptable benchmark suite.

Classes

cached_weakref_property

Functions

integer_range(dtype[, include_invalid])

Given an integer dtype, return the range [lo, hi] of values representable

integer_valid_range(dtype)

Given an integer dtype, return the range [lo, hi] of valid values

rand_floats(gen[, low, high, size, dtype, include_invalid])

Generate a random array of floating-point values with the specified length and dtype.

rand_integers(gen[, size, dtype, include_invalid])

Generate a random array of integers with the specified length and dtype.

trial_size([low, high, scale_factor])

Generates a list of input sizes to benchmark against.

zeros_eager(shape, dtype)

Attributes

_DOUBLING_TRIAL_16

_DOUBLING_TRIAL_32

_DOUBLING_TRIAL_MAX

_INT_16_MAX

_INT_32_MAX

_INT_MAX

_SEED

Value used to seed random number generators so we get "random" data for

_dtypes_by_group

cached_property

dtypes_by_group

np.typecodes but the value for each entry is a list containing the

class riptable.Utils.common.cached_weakref_property(func)
_NO_OBJECT
_WEAKREF_CACHE_NAME = '_weakref_cache'
__get__(instance, owner=None)
__set_name__(owner, name)
riptable.Utils.common.integer_range(dtype, include_invalid=False)

Given an integer dtype, return the range [lo, hi] of values representable by the type, optionally excluding the invalid value (if any) for the type.

riptable.Utils.common.integer_valid_range(dtype)

Given an integer dtype, return the range [lo, hi] of valid values representable by that dtype.

Parameters:

dtype (data-type) – An integer dtype.

riptable.Utils.common.rand_floats(gen, low=0.0, high=1.0, size=None, dtype=np.float64, include_invalid=False)

Generate a random array of floating-point values with the specified length and dtype.

The elements of the array are drawn from the uniform distribution over the range [low, high).

riptable.Utils.common.rand_integers(gen, size=None, dtype=np.int64, include_invalid=False)

Generate a random array of integers with the specified length and dtype.

The elements of the array will span the representable range of the dtype, optionally including the ‘invalid’ value for the type. The elements of the array are drawn from the ‘discrete uniform’ distribution.

riptable.Utils.common.trial_size(low=250, high=_INT_16_MAX, scale_factor=2)

Generates a list of input sizes to benchmark against.

riptable.Utils.common.zeros_eager(shape, dtype)
riptable.Utils.common._DOUBLING_TRIAL_16
riptable.Utils.common._DOUBLING_TRIAL_32
riptable.Utils.common._DOUBLING_TRIAL_MAX
riptable.Utils.common._INT_16_MAX
riptable.Utils.common._INT_32_MAX
riptable.Utils.common._INT_MAX
riptable.Utils.common._SEED = 1234

Value used to seed random number generators so we get “random” data for the benchmarks while also allowing the benchmarks to be repeatable.

riptable.Utils.common._dtypes_by_group
riptable.Utils.common.cached_property
riptable.Utils.common.dtypes_by_group: Mapping[str, List[numpy.dtype]]

np.typecodes but the value for each entry is a list containing the dtypes corresponding to the typecode(s) for the original entry.