class_docstr: Test AtomicCoordinates.
class_docstr_tok: ["Test","AtomicCoordinates","."]
docstr: Test that neighbor lists return only max_num_neighbors.
docstr_tok: ["Test","that","neighbor","lists","return","only","max_num_neighbors","."]
code: def test_neighbor_list_max_num_neighbors(self):
      """
      Test that neighbor lists return only max_num_neighbors.
      """
      N = self.mol.GetNumAtoms()
  
      max_num_neighbors = 1
      nblist_featurizer = NeighborListAtomicCoordinates(
          max_num_neighbors
      )
      nblist = nblist_featurizer._featurize(self.mol)[1]
  
      for atom in range(N):
          assert len(nblist[atom]) <= max_num_neighbors
  
      # Do a manual distance computation and ensure that selected neighbor is
      # closest since we set max_num_neighbors = 1
      coords = self.get_angstrom_coords(self.mol)
      for i in range(N):
          closest_dist = np.inf
          closest_nbr = None
          for j in range(N):
              if i == j:
                  continue
              dist = np.linalg.norm(coords[i] - coords[j])
              logger.info("Distance(%d, %d) = %f" % (i, j, dist))
              if dist < closest_dist:
                  closest_dist = dist
                  closest_nbr = j
          logger.info("Closest neighbor to %d is %d" % (i, closest_nbr))
          logger.info("Distance: %f" % closest_dist)
          if closest_dist < nblist_featurizer.neighbor_cutoff:
              assert nblist[i] == [closest_nbr]
          else:
              assert nblist[i] == []
  
file_path: deepchem/deepchem/feat/tests/test_atomic_coordinates.py
imports: import os
  import logging
  import numpy
  import unittest
  from deepchem.utils import conformers
  from deepchem.feat import AtomicCoordinates
  from deepchem.feat import NeighborListAtomicCoordinates
  from deepchem.feat import NeighborListComplexAtomicCoordinates
label_desc: Use image node_id 5 for calling the TestAtomicCoordinates obj's underlying member method code with example usage: obj.test_neighbor_list_max_num_neighbors() without return types