SMS_BP
Single Molecule Simulations -BP
Loading...
Searching...
No Matches
SMS_BP.decorators Namespace Reference

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''))
 

Function Documentation

◆ _catch_recursion_error()

SMS_BP.decorators._catch_recursion_error ( func)
protected

◆ cache()

SMS_BP.decorators.cache ( func)
Keep a cache of previous function calls

◆ debug()

SMS_BP.decorators.debug ( func)
Print the function signature and return value

◆ deprecated()

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.

◆ repeat()

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

◆ set_unit()

SMS_BP.decorators.set_unit ( unit)
Register a unit on a function

◆ singleton()

SMS_BP.decorators.singleton ( cls)
Make a class a Singleton class (only one instance)

◆ slow_down()

SMS_BP.decorators.slow_down ( _func = None,
* ,
rate = 1 )
Sleep given amount of seconds before calling the function

◆ timer()

SMS_BP.decorators.timer ( func)
Print the runtime of the decorated function

Variable Documentation

◆ string_types

tuple SMS_BP.decorators.string_types = (type(b''), type(u''))