pyworkflow.utils.reflection module

This module contains reflection utilities (dynamically load classes, inspect object properties and others)

pyworkflow.utils.reflection.checkPlugin(module)[source]
pyworkflow.utils.reflection.getModules(path)[source]

Try to find possible sub-modules under path. A dictionary will be returned with modules names as keys and the modules objects as values.

pyworkflow.utils.reflection.getSubclasses(BaseClass, inputDict)[source]

Iterate over inputDict and find all subclasses of BaseClass, that will be set in outputDict.

pyworkflow.utils.reflection.getSubclassesFromModules(BaseClass, modules, debug=False)[source]

Find subclasses of BaseClass from a give dict of modules.

pyworkflow.utils.reflection.getSubclassesFromPath(BaseClass, path)[source]

Try to find possible sub-packages under path and find subclasses of BaseClass from them Return a dictionary containing the subclasses.

pyworkflow.utils.reflection.isModuleAFolder(modulename)[source]

Returns True if a python module is a folder

pyworkflow.utils.reflection.isModuleLoaded(modulename)[source]

Return True if a python module is loaded, False otherwise

pyworkflow.utils.reflection.isSameFunction(function1, function2)[source]

Check if the content of 2 functions is the same. This could be used to check if a method has been overridden or not From https://stackoverflow.com/questions/13620542/detecting-empty-function-definitions-in-python