sup3r.preprocessing.utilities

sup3r.preprocessing.utilities#

Methods used across container objects.

Functions

check_signatures(objs[, skip_params])

Make sure signatures of objects can be parsed for required arguments.

composite_info(objs[, skip_params])

Get composite signature and doc string for given set of objects.

composite_sig(docs)

Get composite signature from command documentation instance.

compute_if_dask(arr)

Apply compute method to input if it consists of a dask array or slice with dask elements.

contains_ellipsis(vals)

Check if vals contain an ellipse.

dims_array_tuple(arr)

Return a tuple of (dims, array) with dims equal to the ordered slice of Dimension.order() with the same len as arr.shape.

expand_paths(fps)

Expand path(s)

get_class_kwargs(obj, kwargs)

Get kwargs which match obj signature.

get_date_range_kwargs(time_index)

Get kwargs for pd.date_range from a DatetimeIndex.

get_input_handler_class([input_handler_name])

Get the DataHandler or Rasterizer object.

get_obj_params(obj)

Get available signature parameters for obj and obj bases

get_source_type(file_paths)

Get data source type

is_type_of(vals, vtype)

Check if vals is an instance of type or group of that type.

log_args(func)

Decorator to log annotations and args.

lower_names(data)

Set all fields / coords / dims to lower case.

lowered(features)

Return a lower case version of the given str or list of strings.

make_time_index_from_kws(date_range_kwargs)

Function to make a pandas DatetimeIndex from the get_date_range_kwargs outputs

numpy_if_tensor(arr)

Cast array to numpy array if it is a tensor.

ordered_array(data)

Transpose arrays so they have a (space, time, ...) or (space, time, ..., feature) ordering.

ordered_dims(dims)

Return the order of dims that follows the ordering of Dimension.order() for the common dim names.

parse_ellipsis(vals, dim_num)

Replace ellipsis with N slices where N is dim_num - len(vals) + 1

parse_features([features, data])

Parse possible inputs for features (list, str, None, 'all').

parse_keys(keys[, default_coords, ...])

Return set of features and slices for all dimensions contained in dataset that can be passed to isel and transposed to standard dimension order.

parse_to_list([features, data])

Parse features and return as a list, even if features is a string.