|
SMS_BP
Single Molecule Simulations -BP
|
Classes | |
| class | CountCalls |
Functions | |
| deprecated (reason) | |
| timer (func) | |
| debug (func) | |
| slow_down (_func=None, *, rate=1) | |
| repeat (_func=None, *, num_times=2) | |
| singleton (cls) | |
| cache (func) | |
| set_unit (unit) | |
| _catch_recursion_error (func) | |
Variables | |
| tuple | string_types = (type(b''), type(u'')) |
|
protected |
| SMS_BP.decorators.cache | ( | func | ) |
Keep a cache of previous function calls
| SMS_BP.decorators.debug | ( | func | ) |
Print the function signature and return value
| SMS_BP.decorators.deprecated | ( | reason | ) |
This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.
| SMS_BP.decorators.repeat | ( | _func = None, | |
| * | , | ||
| num_times = 2 ) |
Repeat the function a number of times
Parameters:
-----------
num_times : int
number of times to repeat the function
Returns:
--------
decorator_repeat : function
decorator function
| SMS_BP.decorators.set_unit | ( | unit | ) |
Register a unit on a function
| SMS_BP.decorators.singleton | ( | cls | ) |
Make a class a Singleton class (only one instance)
| SMS_BP.decorators.slow_down | ( | _func = None, | |
| * | , | ||
| rate = 1 ) |
Sleep given amount of seconds before calling the function
| SMS_BP.decorators.timer | ( | func | ) |
Print the runtime of the decorated function
| tuple SMS_BP.decorators.string_types = (type(b''), type(u'')) |