File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change 16
16
import numpy as np
17
17
import numpy .typing as npt
18
18
from loguru import logger
19
+ from rdkit import rdBase
19
20
from rdkit import Chem
20
21
from rdkit .Chem import Descriptors
21
22
from sklearn .preprocessing import StandardScaler
@@ -133,13 +134,15 @@ def pretransform_single(
133
134
Descriptor vector for given molecule. None if calculation failed.
134
135
"""
135
136
vec = np .full ((len (self ._descriptor_list ),), np .nan )
137
+ log_block = rdBase .BlockLogs () # pylint: disable=unused-variable
136
138
for i , name in enumerate (self ._descriptor_list ):
137
139
descriptor_func = RDKIT_DESCRIPTOR_DICT [name ]
138
140
try :
139
141
vec [i ] = descriptor_func (value )
140
142
except Exception : # pylint: disable=broad-except
141
143
if self ._log_exceptions :
142
144
logger .exception (f"Failed calculating descriptor: { name } " )
145
+ del log_block
143
146
if not self ._return_with_errors and np .any (np .isnan (vec )):
144
147
return InvalidInstance (self .uuid , "NaN in descriptor vector" , self .name )
145
148
return vec
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ authors = [
11
11
{name = " Jochen Sieg" }
12
12
]
13
13
description = " Integration of rdkit functionality into sklearn pipelines."
14
- version = " 0.8.4 "
14
+ version = " 0.8.5 "
15
15
readme = " README.md"
16
16
17
17
[tool .setuptools .dynamic ]
You can’t perform that action at this time.
0 commit comments