datamol.log
¶
without_rdkit_log
¶
Context manager to disable RDKit logs. By default all logs are disabled.
Example:
import datamol as dm
with dm.without_rdkit_log():
mol = dm.to_mol("CCCCO") # potential RDKit logs won't show
Source code in datamol/log.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
disable_rdkit_log()
¶
Disable all rdkit logs.
Source code in datamol/log.py
65 66 67 68 |
|
enable_rdkit_log()
¶
Enable all rdkit logs.
Source code in datamol/log.py
71 72 73 74 |
|
no_rdkit_log(func=None, *, mute_errors=True, mute_warning=True, mute_info=True, mute_debug=True, enable=True)
¶
Decorator to disable RDKit logs.
This decorator can be used to suppress RDKit logs when executing a specific function. By default, all log levels (error, warning, info, and debug) are muted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mute_errors |
Whether to mute error logs (default is True). |
True
|
|
mute_warning |
Whether to mute warning logs (default is True). |
True
|
|
mute_info |
Whether to mute info logs (default is True). |
True
|
|
mute_debug |
Whether to mute debug logs (default is True). |
True
|
|
enable |
bool
|
Whether to enable the log muting (default is True). If set to False, no logs will be muted. |
True
|
Example:
@no_rdkit_log()
def example_function():
# Your function code here
pass
example_function() # RDKit logs won't show during this function's execution
Source code in datamol/log.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 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 |
|