3b3a06ad8402079c2d18718349d5f0f212ac7b81,deepchem/feat/base_classes.py,ComplexFeaturizer,featurize,#ComplexFeaturizer#Any#Any#,158

Before Change


      Indices of complexes that failed to featurize.
    

    pool = multiprocessing.Pool()
    results = []
    for i, (mol_file, protein_pdb) in enumerate(zip(mol_files, protein_pdbs)):
      log_message = "Featurizing %d / %d" % (i, len(mol_files))
      results.append(
          pool.apply_async(ComplexFeaturizer._featurize_callback,
                           (self, mol_file, protein_pdb, log_message)))
    pool.close()
    features = []
    failures = []
    for ind, result in enumerate(results):
      new_features = result.get()

After Change


    if not isinstance(complexes, Iterable):
      complexes = [cast(Tuple[str, str], complexes)]
    features = []
    for i, point in enumerate(complexes):
      if i % log_every_n == 0:
        logger.info("Featurizing datapoint %i" % i)
      try:
        features.append(self._featurize(point))
      except:
        logger.warning(
            "Failed to featurize datapoint %i. Appending empty array." % i)
        features.append(np.array([]))

    features = np.asarray(features)
    return features

  def _featurize(self, complex: Tuple[str, str]):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: deepchem/deepchem
Commit Name: 3b3a06ad8402079c2d18718349d5f0f212ac7b81
Time: 2020-12-11
Author: nfrey213@gmail.com
File Name: deepchem/feat/base_classes.py
Class Name: ComplexFeaturizer
Method Name: featurize


Project Name: calico/basenji
Commit Name: b5cac138037548c6c12c3a1b052f16a34c665162
Time: 2016-12-19
Author: drk@calicolabs.com
File Name: bin/basenji_sat.py
Class Name:
Method Name: parse_input


Project Name: danforthcenter/plantcv
Commit Name: e628b2e6c566b9dd70d8eab50c00df23bb0cecea
Time: 2020-08-17
Author: noahfahlgren@gmail.com
File Name: plantcv/parallel/multiprocess.py
Class Name:
Method Name: multiprocess