Skip to content

Commit

Permalink
suppress deprecation warning in RDKitDescriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
PatWalters committed Jul 31, 2024
1 parent 6a3c942 commit 610dc60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion useful_rdkit_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
from .split_utils import *
from .scaffold_finder import *

__version__ = "0.61"
__version__ = "0.62"
5 changes: 4 additions & 1 deletion useful_rdkit_utils/descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from rdkit.Chem.Descriptors import MolWt, MolLogP, NumHDonors, NumHAcceptors, TPSA
from rdkit.Chem.rdchem import Mol
from tqdm.auto import tqdm
import warnings


# ----------- Descriptors and fingerprints
Expand Down Expand Up @@ -116,7 +117,9 @@ def calc_mol(self, mol: Mol) -> np.ndarray:
:return: a numpy array with descriptors
"""
if mol is not None:
res = np.array([apply_func(name, mol) for name in self.desc_names], dtype=float)
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=DeprecationWarning)
res = np.array([apply_func(name, mol) for name in self.desc_names], dtype=float)
else:
res = np.array([None] * len(self.desc_names))
return res
Expand Down

0 comments on commit 610dc60

Please sign in to comment.