From 56c3da4d6a6a67959bc1d9225b84a4bfff187426 Mon Sep 17 00:00:00 2001 From: Alejandro Velez-Arce Date: Sun, 8 Sep 2024 19:17:39 -0400 Subject: [PATCH] fix up acanet demo --- tdc/single_pred/mpc.py | 7 ++----- tdc/test/test_dataloaders.py | 9 +++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tdc/single_pred/mpc.py b/tdc/single_pred/mpc.py index a90358dd..9891537c 100644 --- a/tdc/single_pred/mpc.py +++ b/tdc/single_pred/mpc.py @@ -38,11 +38,8 @@ def get_from_gh(self, link): return self.data def get_data(self, link=None, get_from_gh=True): - if (not get_from_gh) and link is None: - raise Exception( - "provide dataset github link from https://github.com/bidd-group/MPCD" - ) - elif get_from_gh: + link = link if link is not None else self.name + if get_from_gh: return self.get_from_gh(link) # support direct interfface with MoleculeACE API as well from MoleculeACE import Data, Descriptors diff --git a/tdc/test/test_dataloaders.py b/tdc/test/test_dataloaders.py index b43e1f5e..9080c5c5 100644 --- a/tdc/test/test_dataloaders.py +++ b/tdc/test/test_dataloaders.py @@ -124,6 +124,15 @@ def test_resource_dataverse_dataloader_raw_splits(self): pd.DataFrame) assert not splits["dev"] + def test_mpc(self): + from tdc.single_pred.mpc import MPC + Xs = MPC(name = "https://raw.githubusercontent.com/bidd-group/MPCD/main/dataset/ADMET/DeepDelta_benchmark/Caco2.csv") + Xs_split = Xs.get_split() + Xs_train = Xs_split["train"] + Xs_test = Xs_split["test"] + y_train_pIC50 = Xs_train["Y"] + y_test_pIC50 = Xs_test["Y"] + def tearDown(self): try: print(os.getcwd())