pharmai / plip

Protein-Ligand Interaction Profiler - Analyze and visualize non-covalent protein-ligand interactions in PDB files according to 📝 Adasme et al. (2021), https://doi.org/10.1093/nar/gkab294
http://plip.biotec.tu-dresden.de
GNU General Public License v2.0
458 stars 106 forks source link

fixes NumPy DeprecationWarning #150

Closed QY0831 closed 7 months ago

QY0831 commented 8 months ago

my numpy version is: numpy 1.24.4 py38h59b608b_0 conda-forge

dct[np.uint32(i)] = i the line above will raise a DeprecationWarning when passing a negative number to np.uint32 :

plip/basic/supplemental.py:361: DeprecationWarning: NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays.  The conversion of -1000 to uint32 will fail in the future.
   For the old behavior, usually:
       np.array(value).astype(dtype)`
   will give the desired result (the cast overflows).
      dct[np.uint32(i)] = i

so I changed it to dct[int(np.array(i).astype(np.uint32))] = i

Thank you.