File tree Expand file tree Collapse file tree
topobench/data/loaders/graph Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77from omegaconf import DictConfig
88from torch_geometric .data import Data , InMemoryDataset
99
10+ try :
11+ from ogb .utils .mol import smiles2graph
12+ from tdc .single_pred import ADME
13+
14+ _ADME_DEPS_AVAILABLE = True
15+ except ImportError :
16+ _ADME_DEPS_AVAILABLE = False
17+
1018from topobench .data .loaders .base import AbstractLoader
1119
1220
@@ -64,14 +72,11 @@ def load_dataset(self) -> InMemoryDataset:
6472 ImportError
6573 If `PyTDC` or `rdkit` (via `ogb`) are not installed.
6674 """
67- try :
68- from ogb .utils .mol import smiles2graph
69- from tdc .single_pred import ADME
70- except ImportError as e :
75+ if not _ADME_DEPS_AVAILABLE :
7176 raise ImportError (
7277 "ADME datasets require additional dependencies. "
7378 "Install them with: pip install PyTDC rdkit"
74- ) from e
79+ )
7580
7681 class _ADMEDataset (InMemoryDataset ):
7782 """Internal InMemoryDataset for ADME data.
You can’t perform that action at this time.
0 commit comments