misc

module of dascore.utils source

Misc Utilities.

Functions

Name Description
all_close Return True if ar1 is allcose to ar2.
all_diffs_close_enough Check if all the diffs are ‘close’ handling timedeltas.
broadcast_for_index For a given shape of array, return empty slices except for slice axis.
cached_method Cache decorated method.
check_filter_kwargs Check filter kwargs and return dim name and filter range.
check_filter_range Simple check on filter parameters.
check_filter_sequence Ensure the filter sequence is the right shape.
get_middle_value Get the middle value in the differences array without changing dtype.
get_parent_code_name Get the name of the calling function/class levels up in stack.
get_stencil_coefs Get centered coefficients for a derivative of specified order and derivative.
is_valid_coord_str Return True if an input string is valid for representing coord info.
iterate Return an iterable from any object.
maybe_get_items Maybe get items from a mapping (if they exist).
optional_import Import a module and return the module object if installed, else raise error.
register_func Decorator for registering a function name in a list or dict.
sanitize_range_param Given a slice or tuple, check and return slice or tuple.
suppress_warnings Context manager for suppressing warnings.
to_object_array Convert a sequence of objects to a numpy array of objects.
to_str Convert value to string.
unbyte Ensure a string is given by str or possibly bytes.
warn_or_raise A helper function to issues a warning, raise an exception or do nothing.
yield_sub_sequences Yield subsequences of a sequence for specified length.

Classes

Name Description
CacheDescriptor A descriptor for storing infor in an instance cache (mapping).
MethodNameSpace A namespace for class methods.