cli_utils#

General CLI utility functions.

This module provides helpers for common command-line tasks such as: - Parsing ‘lat,lon’ strings into float tuples - Converting memory size strings (e.g., “10MB”, “2GB”) into bytes - Determining coordinate extents from NetCDF mask datasets - Consolidating coordinate inputs from strings, mask files, or explicit values

Functions#

get_available_mem_in_unit(available_mem)

Convert a memory string with units into an integer number of bytes.

get_coords([lonlatbox, mask_file, lon_min, ...])

Get coordinate bounds from a lonlatbox string, mask file, or explicit values.

get_coords_from_mask(mask[, mask_key, ...])

Get the coordinate extents from a mask NetCDF file.

parse_coords(coords_str)

Split the input string of 'lat,lon' by comma and convert each part to a float.