Source code for pytups.utils.helpers

__all__ = ['assert_list', 'params_validators']

[docs] def assert_list(input_item): """ Ensure the input is a list. If the input is not a list, it converts it into a single-element list. Parameters ---------- input_item : any The item to be converted to a list if it is not already one. Returns ------- list A list containing the input item(s). If input_item is None, returns an empty list. """ if isinstance(input_item, list): return input_item elif input_item is not None: return [input_item] else: return []
[docs] def params_validators(key, value): """ Validate and process a parameter for the NOAA studies. This function performs validations on parameter values such as latitude, longitude, keywords, and year ranges. Parameters ---------- key : str The name of the parameter. value : any The value of the parameter. Returns ------- None This function is currently a stub for validation logic. Notes ----- Implement appropriate validations based on project requirements. """ pass