bellini.api.utils

A set of utility functions that are useful when interacting with a mix of Quantities, Distributions, and other numerical primitives

Module Attributes

args_to_quantity(args)

A function that converts all values in args to Quantities

Functions

args_to_quantity(args)

A function that converts all values in args to Quantities

check_broadcastable(*args)

Check if the provided args are broadcastable

check_shape(a, b)

Checks if the shape of a and b is the same

flatten(args[, keep_keys])

Flatten a nested set of lists, tuples, and dicts

is_arr(arr)

Returns if num is either an array or a Quantity holding an array

is_scalar(num)

Returns if num is a scalar i.e. float, int, or np.generic.

mask(arr, idxs[, invert])

Returns a mask for arr at positions idxs