Unverified Commit ba3036d1 authored by Gao, Xiang's avatar Gao, Xiang Committed by GitHub
Browse files

add limited python2 compatibility (#13)

parent 87c4184a
......@@ -12,3 +12,4 @@ steps:
commands:
- flake8
- python setup.py test
- python2 setup.py test
\ No newline at end of file
import torchani
import unittest
import tempfile
import os
import torch
import torchani.pyanitools as pyanitools
import torchani.data
from math import ceil
from bisect import bisect
from pickle import dump, load
import sys
if sys.version_info.major >= 3:
import torchani
import unittest
import tempfile
import os
import torch
import torchani.pyanitools as pyanitools
import torchani.data
from math import ceil
from bisect import bisect
from pickle import dump, load
path = os.path.dirname(os.path.realpath(__file__))
dataset_dir = os.path.join(path, 'dataset')
path = os.path.dirname(os.path.realpath(__file__))
dataset_dir = os.path.join(path, 'dataset')
class TestDataset(unittest.TestCase):
class TestDataset(unittest.TestCase):
def setUp(self, data_path=dataset_dir):
self.data_path = data_path
......@@ -158,6 +159,5 @@ class TestDataset(unittest.TestCase):
e2 = i2[2].item()
self.assertEqual(e1, e2)
if __name__ == '__main__':
if __name__ == '__main__':
unittest.main()
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment