Skip to content

Commit

Permalink
Removing some left over 'infinity' strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Bharath Ramsundar authored and Bharath Ramsundar committed Sep 1, 2020
1 parent e3f847c commit 139792e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions deepchem/feat/graph_features.py
Expand Up @@ -446,8 +446,7 @@ def max_pair_distance_pairs(mol: RDKitMol,
max_distance = N
elif max_pair_distance is not None and max_pair_distance <= 0:
raise ValueError(
"max_pair_distance must either be a positive integer or the string 'infinity'"
)
"max_pair_distance must either be a positive integer or None")
elif max_pair_distance is not None:
max_distance = max_pair_distance
adj = rdmolops.GetAdjacencyMatrix(mol)
Expand Down Expand Up @@ -813,12 +812,9 @@ def __init__(self,
self.explicit_H = explicit_H
# If uses use_chirality
self.use_chirality = use_chirality
if (isinstance(max_pair_distance, int) and
max_pair_distance <= 0) or (isinstance(max_pair_distance, str) and
max_pair_distance != "infinity"):
if isinstance(max_pair_distance, int) and max_pair_distance <= 0:
raise ValueError(
"max_pair_distance must either be a positive integer or the string 'infinity'"
)
"max_pair_distance must either be a positive integer or None")
self.max_pair_distance = max_pair_distance
if self.use_chirality:
self.bt_len = int(GraphConvConstants.bond_fdim_base) + len(
Expand Down
2 changes: 1 addition & 1 deletion deepchem/models/graph_models.py
Expand Up @@ -295,7 +295,7 @@ def compute_features_on_batch(self, X_b):
pair_feat: np.ndarray
Of shape `(N_pairs, N_pair_feat)`. Note that `N_pairs` will depend on
the number of pairs being considered. If `max_pair_distance` is
"infinity", then this will be `N_atoms**2`. Else it will be the number
`None`, then this will be `N_atoms**2`. Else it will be the number
of pairs within the specifed graph distance.
pair_split: np.ndarray
Of shape `(N_pairs,)`. The i-th entry in this array will tell you the
Expand Down

0 comments on commit 139792e

Please sign in to comment.