Skip to content

Commit

Permalink
feat: add tox Dataset.
Browse files Browse the repository at this point in the history
  • Loading branch information
0h-n0 committed Feb 12, 2019
1 parent a639817 commit cea46f4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
Empty file.
Empty file.
16 changes: 16 additions & 0 deletions torchex/data/datasets/graph/tox21.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from pathlib import Path

from ..utils import download

class Tox21Dataset(object):
def __init__(self, root_path='~/.torchex_data/tox21', datatype='train'):
self.root_path = Path(root_path).expanduser().resolve()
self.datatype = datatype

assert datatype in ['train', 'val', 'test'], \
'datatype must be [train, val, test]. ({})'.format(datatype)
download('https://tripod.nih.gov/tox21/challenge/download?', self.root_path)


if __name__ == '__main__':
d = Tox21Dataset()
6 changes: 6 additions & 0 deletions torchex/data/datasets/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

import requests

def download(url, root_path):
requests.urlretrieve(url, root_path)
pass

0 comments on commit cea46f4

Please sign in to comment.