Commit 027d03e7 authored by Bharath Ramsundar's avatar Bharath Ramsundar Committed by GitHub
Browse files

Merge pull request #883 from rbharath/warnings

Disabling UserWarning in RdkitGridFeaturizer
parents 63610f09 cba83b26
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -590,7 +590,11 @@ def compute_hydrogen_bonds(protein_xyz, protein, ligand_xyz, ligand,
  return (hbond_contacts)


def convert_atom_to_voxel(molecule_xyz, atom_index, box_width, voxel_width):
def convert_atom_to_voxel(molecule_xyz,
                          atom_index,
                          box_width,
                          voxel_width,
                          verbose=False):
  """
  Converts an atom to an i,j,k grid index.
  """
@@ -600,6 +604,7 @@ def convert_atom_to_voxel(molecule_xyz, atom_index, box_width, voxel_width):
      (molecule_xyz[atom_index, :] + np.array([box_width, box_width, box_width]
                                             ) / 2.0) / voxel_width).astype(int)
  if ((indices < 0) | (indices >= box_width / voxel_width)).any():
    if verbose:
      warn(
          'Coordinates are outside of the box (atom id = %s, coords xyz = %s, coords in box = %s'
          % (atom_index, molecule_xyz[atom_index], indices))