Modules that defines the package custom decorators displayed to user.
-
bredala.signaturedecorator.
annotate
(profiler, out, module_name, obj_code)[source]¶ Dump annotated input object source code with current profiling statistics to ‘out’ stream. Time unit is second.
Parameters: profiler: pprofile.Profile (mandatory)
a profiler.
out: stream (mandatory)
destination of annotated input object source code.
module_name:
the name of the module of interest (used to filter the execution list).
obj_code: list of str (mandatory)
the source code of the object of interest (used to filter the execution list).
-
bredala.signaturedecorator.
array_repr
(array)[source]¶ Representation of a numpy array.
Parameters: array: array (mandatory)
a numpy array.
Returns: repr: str
the representation of the numpy array.
-
bredala.signaturedecorator.
bredala_signature
(obj, is_method=False, use_profiler=True, type_decorators=None)[source]¶ Create a decorator that display a function or a class method signature and execution time.
Parameters: obj: callable (mandatory)
a function or a class method object.
is_method: bool (optional, default False)
True if the input object it a method of a class, False otherwise.
use_profiler: bool (optional, default True)
if True display the input object execution profile.
type_decorators: list of 2-uplet (optional, default None)
a list of decorator function, parameters ad tuple of types.