Skip to content

Commit

Permalink
Adding atom_descriptors_size property to CommonArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
swansonk14 committed Sep 12, 2020
1 parent 3472968 commit 41bad1c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions chemprop/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ class CommonArgs(Tap):
Whether to not cache the RDKit molecule for each SMILES string to reduce memory usage (cached by default).
"""

def __init__(self, *args, **kwargs):
super(CommonArgs, self).__init__(*args, **kwargs)
self._atom_descriptors_size = 0

@property
def device(self) -> torch.device:
"""The :code:`torch.device` on which to load and process data and models."""
Expand Down Expand Up @@ -125,6 +129,15 @@ def features_scaling(self) -> bool:
"""Whether to apply normalization with a :class:`~chemprop.data.scaler.StandardScaler` to the additional molecule-level features."""
return not self.no_features_scaling

@property
def atom_descriptors_size(self) -> int:
"""The size of the atom descriptors."""
return self._atom_descriptors_size

@atom_descriptors_size.setter
def atom_descriptors_size(self, atom_descriptors_size: int) -> None:
self._atom_descriptors_size = atom_descriptors_size

def add_arguments(self) -> None:
self.add_argument('--gpu', choices=list(range(torch.cuda.device_count())))
self.add_argument('--features_generator', choices=get_available_features_generators())
Expand Down

0 comments on commit 41bad1c

Please sign in to comment.