arim.helpers#

Helper functions

Cache()

Dict-like which keeps track of which values were retrieved and how many times.

NoCache()

Looks like a cache but actually unable to retain anything.

chunk_array(array_shape, block_size[, axis])

Yield selectors to split a array into multiple chunk.

get_git_version([short])

Returns the current git revision as a string.

get_name(metadata)

Return the name of an object based on the dictionary metadata.

get_shape_safely(array, array_name[, ...])

Return the shape of an array.

parse_enum_constant(enum_constant_or_name, ...)

Return the enumerated constant corresponding to 'enum_constant_or_name', which can be either this constant or a its name (string).

sizeof_fmt(num[, suffix])

Human-readable memory size.

smallest_uint_that_fits(max_value)

Return the smallest unsigned integer datatype (dtype) such as all numbers between 0 and 'max_value' can be stored without overflow.

timeit([name, logger, log_level])

A context manager for timing some code.