Skip to content

decorators

sgp.decorators.config module-attribute

config = Config(verbose=lower() in trues, password=get('SGP_PASSWORD', ''), numba_enabled=get('NUMBA_DISABLE_JIT', '0') == '0', language=value('language', name()))

sgp.decorators.execute_in_thread

execute_in_thread(func: Callable = None, *, slot: Callable = None)

Execute a function in a separate thread, usually for functions that do not return a value. For functions that return a value, use the slot parameter to connect the resultReady signal to a function that will receive the result.

PARAMETER DESCRIPTION
func

Function to be executed in a separate thread, by default None

TYPE: Callable DEFAULT: None

slot

Function to be connected to the resultReady signal when the result is ready, by default None

TYPE: Callable DEFAULT: None

sgp.decorators.timing

timing(func: Callable = None, *, target: Callable[[str], Any] = print)

Print the time taken for a function to execute.

PARAMETER DESCRIPTION
func

Function to be timed, by default None

TYPE: Callable DEFAULT: None

target

Function to print the timing information, by default print

TYPE: Callable[[str], Any] DEFAULT: print