utils
close_logs
close_logs(func: Callable)
Wrap a function/method to close the functions first arguments .log attribute FileHandlers after use
Source code in symdesign/protocols/utils.py
23 24 25 26 27 28 29 30 31 32 |
|
remove_structure_memory
remove_structure_memory(func)
Decorator to remove large memory attributes from the instance after processing is complete
Source code in symdesign/protocols/utils.py
35 36 37 38 39 40 41 42 43 |
|
handle_design_errors
handle_design_errors(errors: tuple[Type[Exception], ...] = catch_exceptions) -> Callable
Wrap a function/method with try: except errors: and log exceptions to the functions first argument .log attribute
This argument is typically self and is in a class with .log attribute
Parameters:
-
errors
(tuple[Type[Exception], ...]
, default:catch_exceptions
) –A tuple of exceptions to monitor. Must be a tuple even if single exception
Returns: Function return upon proper execution, else is error if exception raised, else None
Source code in symdesign/protocols/utils.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
handle_job_errors
handle_job_errors(errors: tuple[Type[Exception], ...] = catch_exceptions) -> Callable
Wrap a function/method with try/except errors
Parameters:
-
errors
(tuple[Type[Exception], ...]
, default:catch_exceptions
) –A tuple of exceptions to monitor. Must be a tuple even if single exception
Returns: Function return upon proper execution, else is error if exception raised, else None
Source code in symdesign/protocols/utils.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
protocol_decorator
protocol_decorator(errors: tuple[Type[Exception], ...] = catch_exceptions) -> Callable
Wrap a function/method with try: except errors: and log exceptions to the functions first argument .log attribute
This argument is typically self and is in a class with .log attribute
Parameters:
-
errors
(tuple[Type[Exception], ...]
, default:catch_exceptions
) –A tuple of exceptions to monitor. Must be a tuple even if single exception
Returns: Function return upon proper execution, else is error if exception raised, else None
Source code in symdesign/protocols/utils.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
|