Unverified Commit 371163ff authored by Bharath Ramsundar's avatar Bharath Ramsundar Committed by GitHub
Browse files

Merge pull request #1658 from peastman/python

Moved to Python 3.5 and 3.7 for Travis
parents 8d94661c efc799b5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
language: python
python:
- '2.7'
- '3.5'
- '3.7'
sudo: required
dist: trusty
dist: xenial
install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O anaconda.sh;
- export python_version=$TRAVIS_PYTHON_VERSION
@@ -21,7 +21,7 @@ install:
script:
- nosetests -q --with-flaky -a '!slow' --with-coverage --cover-package=deepchem
  -v deepchem --nologcapture
- if [ $TRAVIS_PYTHON_VERSION == '3.5' ]; then
- if [ $TRAVIS_PYTHON_VERSION == '3.7' ]; then
      find ./deepchem | grep .py$ |xargs python -m doctest -v;
  fi
- bash devtools/travis-ci/test_format_code.sh
+1 −2
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ from deepchem.utils.save import load_sdf_files
from deepchem.utils.genomics import encode_fasta_sequence
from deepchem.feat import UserDefinedFeaturizer
from deepchem.data import DiskDataset, NumpyDataset, ImageDataset
from scipy import misc
import zipfile
from PIL import Image

@@ -413,7 +412,7 @@ class ImageLoader(DataLoader):
      _, extension = os.path.splitext(image_file)
      extension = extension.lower()
      if extension == ".png":
        image = misc.imread(image_file)
        image = np.array(Image.open(image_file))
        images.append(image)
      elif extension == ".tif":
        im = Image.open(image_file)
+5 −4
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ import os
import unittest
import tempfile
from scipy import misc
from PIL import Image
import deepchem as dc
import zipfile

@@ -26,9 +27,9 @@ class TestImageLoader(unittest.TestCase):
    self.data_dir = tempfile.mkdtemp()
    self.face = misc.face()
    self.face_path = os.path.join(self.data_dir, "face.png")
    misc.imsave(self.face_path, self.face)
    Image.fromarray(self.face).save(self.face_path)
    self.face_copy_path = os.path.join(self.data_dir, "face_copy.png")
    misc.imsave(self.face_copy_path, self.face)
    Image.fromarray(self.face).save(self.face_copy_path)

    # Create zip of image file
    #self.zip_path = "/home/rbharath/misc/cells.zip"
@@ -54,9 +55,9 @@ class TestImageLoader(unittest.TestCase):
    # Create image directory
    self.image_dir = tempfile.mkdtemp()
    face_path = os.path.join(self.image_dir, "face.png")
    misc.imsave(face_path, self.face)
    Image.fromarray(self.face).save(face_path)
    face_copy_path = os.path.join(self.image_dir, "face_copy.png")
    misc.imsave(face_copy_path, self.face)
    Image.fromarray(self.face).save(face_copy_path)

  def test_png_simple_load(self):
    loader = dc.data.ImageLoader()
+1 −1
Original line number Diff line number Diff line
@@ -340,7 +340,7 @@ class TestLayers(test_util.TensorFlowTestCase):
    value = np.random.uniform(size=(2, 3)).astype(np.float32)
    with self.session() as sess:
      result = Exp()(value).eval()
      assert np.array_equal(np.exp(value), result)
      assert np.allclose(np.exp(value), result)

  def test_interatomic_distances(self):
    """Test that the interatomic distance calculation works."""
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ def load_clintox(featurizer='ECFP',
  """Load clintox datasets."""
  if data_dir is None:
    data_dir = DEFAULT_DIR
  else:
  if save_dir is None:
    save_dir = DEFAULT_DIR

  if reload:
Loading