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’.

pysal/pysal

Parameters:
modulesdict

Dictionary containing soft dependencies, e.g., {‘matplotlib’: matplotlib}.

Returns:
decorated_functionfunction

Original function if all soft dependencies are met, otherwise it returns an empty function which prints why it is not running.