module of dascore.utils source

Misc Utilities.


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.
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_slice_from_monotonic Return a slice object which meets conditions in cond on array.
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.
iter_files Use os.scan dir to iter files, optionally only for those with given
iterate Return an iterable from any object.
maybe_get_attrs Maybe get attributes from object (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.
separate_coord_info Separate coordinate information from attr dict.
suppress_warnings Context manager for suppressing warnings.
to_str Convert value to string.
unbyte Ensure a string is given by str or possibly bytes.


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