diff --git a/deepchem/feat/graph_features.py b/deepchem/feat/graph_features.py index 7e51a98a6b..836f536d9f 100644 --- a/deepchem/feat/graph_features.py +++ b/deepchem/feat/graph_features.py @@ -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) @@ -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( diff --git a/deepchem/models/graph_models.py b/deepchem/models/graph_models.py index db284c953d..d64aaaad54 100644 --- a/deepchem/models/graph_models.py +++ b/deepchem/models/graph_models.py @@ -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