Commit a49e6ca2 authored by seyonechithrananda's avatar seyonechithrananda
Browse files

add yapf

parent 510b3780
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -77,11 +77,6 @@ try:
  from transformers import RobertaTokenizerFast
  from deepchem.feat.roberta_tokenizer import RobertaFeaturizer
except ModuleNotFoundError:
  # raise ImportError('This class requires transformers.')
  """   raise ImportWarning(
      'This class requires transformers. Please use "pip install transformers" to continue.'
  )
  """
  pass

# support classes
+4 −2
Original line number Diff line number Diff line
@@ -455,8 +455,10 @@ class DummyFeaturizer(Featurizer):
          'FCC(c1cccc(Br)n1)N1CCOCC1']], dtype='<U55')
  """

  def featurize(self, datapoints: Iterable[Any],
                log_every_n: int = 1000, **kwargs) -> np.ndarray:
  def featurize(self,
                datapoints: Iterable[Any],
                log_every_n: int = 1000,
                **kwargs) -> np.ndarray:
    """Passes through dataset, and returns the datapoint.

    Parameters
+10 −5
Original line number Diff line number Diff line
@@ -81,7 +81,8 @@ class ChargeVoxelizer(ComplexFeaturizer):
    self.voxel_width = voxel_width
    self.reduce_to_contacts = reduce_to_contacts

  def _featurize(self, complex: Tuple[str, str], **kwargs) -> Optional[np.ndarray]:
  def _featurize(self, complex: Tuple[str, str],
                 **kwargs) -> Optional[np.ndarray]:
    """
    Compute featurization for a single mol/protein complex

@@ -167,7 +168,8 @@ class SaltBridgeVoxelizer(ComplexFeaturizer):
    self.voxel_width = voxel_width
    self.reduce_to_contacts = reduce_to_contacts

  def _featurize(self, complex: Tuple[str, str], **kwargs) -> Optional[np.ndarray]:
  def _featurize(self, complex: Tuple[str, str],
                 **kwargs) -> Optional[np.ndarray]:
    """
    Compute featurization for a single mol/protein complex

@@ -252,7 +254,8 @@ class CationPiVoxelizer(ComplexFeaturizer):
    self.box_width = box_width
    self.voxel_width = voxel_width

  def _featurize(self, complex: Tuple[str, str], **kwargs) -> Optional[np.ndarray]:
  def _featurize(self, complex: Tuple[str, str],
                 **kwargs) -> Optional[np.ndarray]:
    """
    Compute featurization for a single mol/protein complex

@@ -455,7 +458,8 @@ class HydrogenBondCounter(ComplexFeaturizer):
      self.angle_cutoffs = angle_cutoffs
    self.reduce_to_contacts = reduce_to_contacts

  def _featurize(self, complex: Tuple[str, str], **kwargs) -> Optional[np.ndarray]:
  def _featurize(self, complex: Tuple[str, str],
                 **kwargs) -> Optional[np.ndarray]:
    """
    Compute featurization for a single mol/protein complex

@@ -560,7 +564,8 @@ class HydrogenBondVoxelizer(ComplexFeaturizer):
    self.voxel_width = voxel_width
    self.reduce_to_contacts = reduce_to_contacts

  def _featurize(self, complex: Tuple[str, str], **kwargs) -> Optional[np.ndarray]:
  def _featurize(self, complex: Tuple[str, str],
                 **kwargs) -> Optional[np.ndarray]:
    """
    Compute featurization for a single mol/protein complex

+2 −1
Original line number Diff line number Diff line
@@ -758,7 +758,8 @@ class ConvMolFeaturizer(MolecularFeaturizer):
  def featurize(
      self,
      molecules: Union[RDKitMol, str, Iterable[RDKitMol], Iterable[str]],
      log_every_n: int = 1000, **kwargs) -> np.ndarray:
      log_every_n: int = 1000,
      **kwargs) -> np.ndarray:
    """
    Override parent: aim is to add handling atom-depleted molecules featurization
    
+2 −1
Original line number Diff line number Diff line
@@ -59,7 +59,8 @@ class ElementPropertyFingerprint(MaterialCompositionFeaturizer):
    self.data_source = data_source
    self.ep_featurizer: Any = None

  def _featurize(self, composition: PymatgenComposition, **kwargs) -> np.ndarray:
  def _featurize(self, composition: PymatgenComposition,
                 **kwargs) -> np.ndarray:
    """
    Calculate chemical fingerprint from crystal composition.

Loading