Skip to content

Commit

Permalink
Merge pull request #240 from mims-harvard/oracle_bug
Browse files Browse the repository at this point in the history
Oracle bug -- fix #238
  • Loading branch information
amva13 committed Apr 9, 2024
2 parents 892f440 + 9844cac commit 30dd806
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ playground.ipynb
test.ipynb
file_structure.ipynb
data/
#oracle/
oracle/

# vim backup
*~
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
- pyg=2.5.0
- pytorch=2.2.1
- requests=2.31.0
- scikit-learn=1.3.0
- scikit-learn=1.2.2
- seaborn=0.12.2
- tqdm=4.65.0
- torchaudio=2.2.1
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ numpy==1.26.4
openpyxl==3.0.10
pandas==2.1.4
requests==2.31.0
scikit-learn==1.3.0
scikit-learn==1.2.2
seaborn==0.12.2
tqdm==4.65.0
cellxgene-census==1.10.2
Expand Down
2 changes: 1 addition & 1 deletion tdc/test/test_dataloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_pentelute(self):

@unittest.skip(
"test is taking up too much memory"
) #FIXME: should probably create much smaller version and use that for the test
) #FIXME: should probably create much smaller version and use that for the test. This test does pass locally, please rerun if changing anndata code.
def test_h5ad_dataloader(self):
from tdc.multi_pred.cellxgene import SingleCellPrediction
from pandas import DataFrame
Expand Down
47 changes: 47 additions & 0 deletions tdc/test/test_oracles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-

from __future__ import division
from __future__ import print_function

import os
import sys

import unittest
import shutil

# temporary solution for relative imports in case TDC is not installed
# if TDC is installed, no need to use the following line
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
# TODO: add verification for the generation other than simple integration


class TestOracle(unittest.TestCase):

def setUp(self):
print(os.getcwd())
pass

def test_gsk3b(self):
from tdc import Oracle

oracle = Oracle(name='GSK3B')

x = oracle('CC(C)(C)[C@H]1CCc2c(sc(NC(=O)COc3ccc(Cl)cc3)c2C(N)=O)C1')
assert abs(x - 0.03) < 0.0001

def test_jnk3(self):
from tdc import Oracle

oracle = Oracle(name='JNK3')

x = oracle('C[C@@H]1CCN(C(=O)CCCc2ccccc2)C[C@@H]1O')
assert abs(x - 0.01) < 0.0001

# def tearDown(self):
# print(os.getcwd())
# shutil.rmtree(os.path.join(os.getcwd(), "data"))


if __name__ == "__main__":
unittest.main()

0 comments on commit 30dd806

Please sign in to comment.