Unverified Commit 0735e5e7 authored by Vignesh Ram Somnath's avatar Vignesh Ram Somnath Committed by GitHub
Browse files

Merge branch 'master' into tf-1.14

parents ee600b31 7d2ac334
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
+7 −5
Original line number Diff line number Diff line
@@ -36,9 +36,11 @@ democratizes the use of deep-learning in drug discovery, materials science, quan
### Soft Requirements
DeepChem has a number of "soft" requirements. These are packages which are needed for various submodules of DeepChem but not for the package as a whole.

* [rdkit](http://www.rdkit.org/docs/Install.html)
* [RDKit](http://www.rdkit.org/docs/Install.html)
* [six](https://pypi.python.org/pypi/six)
* [mdtraj](http://mdtraj.org/)
* [MDTraj](http://mdtraj.org/)
* [PDBFixer](https://github.com/pandegroup/pdbfixer)
* [Pillow](https://pillow.readthedocs.io/en/stable/)

### Super easy install via pip3

@@ -49,9 +51,9 @@ pip3 install joblib pandas sklearn tensorflow pillow deepchem
### Easy Install via Conda

```bash
conda install -c deepchem -c rdkit -c conda-forge -c omnia deepchem=2.1.0
conda install -c deepchem -c rdkit -c conda-forge -c omnia deepchem=2.2.0
```
**Note:** `Easy Install` installs the latest stable version of `deepchem` and _does not install from source_. If you need to install from source make sure you follow the steps [here](#using-a-conda-environment).
**Note:** The above commands install the latest stable version of `deepchem` and _do not install from source_. If you need to install from source make sure you follow the steps [here](#using-a-conda-environment).

### Using a Docker Image
Using a docker image requires an NVIDIA GPU.  If you do not have a GPU please follow the directions for [using a conda environment](#using-a-conda-environment)
@@ -106,7 +108,7 @@ via this installation procedure.

## FAQ and Troubleshooting

1. ```deepchem``` currently supports both Python 2.7 and Python 3.5, and is supported on 64 bit Linux and Mac OSX. Note that DeepChem is not currently maintained for Python 3.6 or with other operating systems. 
1. DeepChem currently supports Python 3.5 through 3.7, and is supported on 64 bit Linux and Mac OSX. Note that DeepChem is not currently maintained for older versions of Python or with other operating systems.
2. Question: I'm seeing some failures in my test suite having to do with MKL
   ```Intel MKL FATAL ERROR: Cannot load libmkl_avx.so or libmkl_def.so.```

+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()
+10 −0
Original line number Diff line number Diff line
@@ -201,6 +201,9 @@ class SmilesToImage(Featurizer):
      # Compute atom properties
      atom_props = np.array([[atom.GetAtomicNum()] for atom in cmol.GetAtoms()])

      bond_props = bond_props.astype(np.float32)
      atom_props = atom_props.astype(np.float32)

    else:
      # Setup image
      img = np.zeros((self.img_size, self.img_size, 4))
@@ -218,6 +221,13 @@ class SmilesToImage(Featurizer):
          atom.GetHybridization().real,
      ] for atom in cmol.GetAtoms()])

      bond_props = bond_props.astype(np.float32)
      atom_props = atom_props.astype(np.float32)

      partial_charges = atom_props[:, 1]
      if np.any(np.isnan(partial_charges)):
        return []

    frac = np.linspace(0, 1, int(1 / self.res * 2))
    # Reshape done for proper broadcast
    frac = frac.reshape(-1, 1, 1)
Loading