exarl.utils.introspect

Module Contents

Functions

ibLoaded()

introspectTrace(position=None, keyword=None, default=0, name=False)

Defines a decorator used to trace functions. Arguments are used to predifine values to trace.

introspect(func)

A decorator that wraps a function with so that when called it updates a function metric with 1

exarl.utils.introspect.ibLoaded()
exarl.utils.introspect.introspectTrace(position=None, keyword=None, default=0, name=False)

Defines a decorator used to trace functions. Arguments are used to predifine values to trace. E.g. A decorated call that should always increment trace by 1 should set the default=1 A call that should trace a value that is passed to the decorated function as the 2 positional argument should set position=1 A call that needs to trace a value that is passed as the size keywork to the underlying argument should set keyword=’size’

Parameters
  • position (int, optional) – size is set to the value in function args[position], by default None

  • keyword (int, optional) – size is set to this keyword value, by default None

  • default (int, optional) – size is set to this value, by default 0

  • name (bool, optional) – prepend an additional name to the trace name, by default False

exarl.utils.introspect.introspect(func)

A decorator that wraps a function with so that when called it updates a function metric with 1

Parameters

func (function) – function to be wrapped

Returns

function – the wrapper for the func argument