discretize.utils.requires#
- discretize.utils.requires(modules)[source]#
Decorate a function with soft dependencies.
This function was inspired by the requires function of pysal, which is released under the ‘BSD 3-Clause “New” or “Revised” License’.
- Parameters:
- modules
dict
Dictionary containing soft dependencies, e.g., {‘matplotlib’: matplotlib}.
- modules
- Returns:
- decorated_function
function
Original function if all soft dependencies are met, otherwise it returns an empty function which prints why it is not running.
- decorated_function