Skip to content
This repository was archived by the owner on Dec 8, 2024. It is now read-only.

Develop #38

Merged
merged 10 commits into from
Mar 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 38 additions & 41 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
language: python

sudo: required
dist: trusty

group: edge

deploy:
provider: pages
- provider: pypi
user: andersx
password:
secure: mXeDkazSavPo2Cx3Drhap9VkT42pK0XCDx2vK8IVsu/3i+fNLg/RtqT/Yg1hhMNWZQ76rg8TfzGWNEDvEa7JNNVpyTrA8CtWkS5KR3Oj/bkP+n7xcQKC2npjsmrReS97mBq4Sp3fEogcsYH9jCzhhMLnlfpoVlWEFDExcqeKwvXxTqvyv2ymdx6QLu1KkOQWCzsBoa6wIqH9kbzUSjqTVKIWgNZh3UHhDDv8X5rJZUUUulnwmbsRHZSTKFRVaB4gqv3s6gqgMZzmFjHdii3O059quEu+JrpisGNJ3EHSyaDZ1hk9DWqBqXK6LhNVjtwDPgHmABXLrZCKJVudm/7fuwI7GdTSghWjhtLDlaZYSVTBD9vD/aabuM397ZLt6ci8d7AD2AoCDWtc/8EjRVjdErVYL0dO0moJAu7mtxnvPKaT0ZWWPwfUQQlPt/vh17gFWOQhF/YT226J8K/nnnBHmhgHMIR7jBr3ve/YuQGLPUcURhTUnqfUS4O4UTkbXG23rOHPRPs45+F42dNlPb0d1d67C2NOtGhuqe14sQ47rip13FtXCq6HG09WJ6tOY7TvBEu+43DzVPam4qSlS5PoVbC2DwZQKEl8YVbXLCOAzaymk+1BAIofZ201wu4M7Y4HbRIdTLM4F2maKxo52c4Dn2flRA8iX5/OTR1osDIo4qg=
on:
branch: master
condition: ${TRAVIS_PYTHON_VERSION} = "2.7"
- provider: pages
local_dir: ${TRAVIS_BUILD_DIR}/docs/build/html
skip_cleanup: true
repo: qmlcode/qmlcode.github.io
Expand All @@ -15,47 +19,40 @@ deploy:
on:
branch: master
condition: ${TRAVIS_PYTHON_VERSION} = "2.7"

python:
- "2.7"
- "3.5"
- "3.6"

- '2.7'
- '3.5'
- '3.6'
before_install:
- sudo apt-get update -qq

- sudo apt-get update -qq
install:
- sudo apt-get install -qq gcc gfortran libblas-dev liblapack-dev
- sudo apt-get install -qq gcc-4.8 gfortran-4.8
- |
if [ ${TRAVIS_PYTHON_VERSION:0:1} = 3 ]; then
sudo apt-get install python3-numpy
pip3 install scipy
python3 setup.py build
python3 setup.py install
pip3 install sphinx
pip3 install sphinx-rtd-theme
cd ${TRAVIS_BUILD_DIR}/docs
make html
elif [ ${TRAVIS_PYTHON_VERSION} = "2.7" ]; then
sudo apt-get install python-numpy
pip2 install scipy
python2 setup.py build
python2 setup.py install
pip2 install sphinx
pip2 install sphinx-rtd-theme
cd ${TRAVIS_BUILD_DIR}/docs
make html
else
echo "ERROR: Unknown Python version."
fi


- sudo apt-get install -qq gcc gfortran libblas-dev liblapack-dev
- sudo apt-get install -qq gcc-4.8 gfortran-4.8
- |
if [ ${TRAVIS_PYTHON_VERSION:0:1} = 3 ]; then
sudo apt-get install python3-numpy
pip3 install scipy
python3 setup.py build
python3 setup.py install
pip3 install sphinx
pip3 install sphinx-rtd-theme
cd ${TRAVIS_BUILD_DIR}/docs
make html
elif [ ${TRAVIS_PYTHON_VERSION} = "2.7" ]; then
sudo apt-get install python-numpy
pip2 install scipy
python2 setup.py build
python2 setup.py install
pip2 install sphinx
pip2 install sphinx-rtd-theme
cd ${TRAVIS_BUILD_DIR}/docs
make html
else
echo "ERROR: Unknown Python version."
fi
before_script:
- cd ${TRAVIS_BUILD_DIR}/tests/

- cd ${TRAVIS_BUILD_DIR}/tests/
script:
- nosetests -v

- nosetests -v
notifications:
email: false
12 changes: 9 additions & 3 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Examples
xamples
--------

Generating representations using the ``Compound`` class
Expand Down Expand Up @@ -106,19 +106,25 @@ The easiest way to calculate the kernel matrix using an explicit, local represen
.. code:: python

import numpy as np
from qml.wrappers import get_atomic_kernels_gaussian
from qml.kernels import get_local_kernels_gaussian

# Assume the QM7 dataset is loaded into a list of Compound()
for compound in qm7:

# Generate the desired representation for each compound
compound.generate_atomic_coulomb_matrix(size=23, sort="row-norm")

# Make a big array with all the atomic representations
X = np.concatenate([mol.representation for mol in qm7])

# Make an array with the number of atoms in each compound
N = np.array([mol.natoms for mol in qm7])

# List of kernel-widths
sigmas = [50.0, 100.0, 200.0]

# Calculate the kernel-matrix
K = get_atomic_kernels_gaussian(qm7, qm7, sigmas)
K = get_local_kernels_gaussian(X, X, N, N, sigmas)

print(K.shape)

Expand Down
3 changes: 1 addition & 2 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ using ``brew``:
# Install GCC
brew install gcc

Note the Clang Fortran compiler from brew unfortunately does not support
OpenMP.
Note the Fortran compiler from brew (gfortran) unfortunately does not support OpenMP.
Therefore parallelism via OpenMP is disabled as default for MacOS systems.

Additionally, we found that some users have multiple version of the ``as`` assembler - this might happen if you have GCC from e.g. brew and macports at the same time. Look for the following error:
Expand Down
7 changes: 7 additions & 0 deletions docs/source/qml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ qml\.arad module
:members:
:show-inheritance:

qml\.fchl module
----------------

.. automodule:: qml.fchl
:members:
:show-inheritance:


qml\.wrappers module
--------------------
Expand Down
86 changes: 86 additions & 0 deletions mkldiscover.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/env python
# MIT License
#
# Copyright (c) 2017 Anders Steen Christensen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from __future__ import print_function

import os

def mkl_exists(verbose=False):

# Get environment variables
__MKLROOT__ = os.environ.get('MKLROOT')
__LD_LIBRARY_PATH__ = os.environ.get('LD_LIBRARY_PATH')

# Check if $MKLROOT is set

if __MKLROOT__ is None:

if verbose:
print("MKL-discover: MKLROOT was not set")

return False

else:

if verbose:
print("MKL-discover: MKLROOT was set to")
print(__MKLROOT__)

# Check if path exists
mklroot_exists = os.path.isdir(__MKLROOT__)

if not mklroot_exists:
if verbose:
print("MKL-discover: MKLROOT path does not exist")

return False

found_libmkl_rt = False

# Check if libmkl_rt.so exists below $MKLROOT
for dirpath, dirnames, filenames in os.walk(__MKLROOT__, followlinks=True):

if "libmkl_rt.so" in filenames:

if verbose:
print("MKL-discover: Found libmkl_rt.so at ", dirpath)

# Check that the dirpath where libmkl_rt.so is in $LD_LIBRARY_PATH
if dirpath in __LD_LIBRARY_PATH__:

if verbose:
print("MKL-discover: Found %s in $LD_LIBRARY_PATH" % dirpath)
print("MKL-discover: Concluding that MKL can be used.")
found_libmkl_rt = True


return found_libmkl_rt

if __name__ == "__main__":

mkl_present = mkl_exists(verbose=False)

if mkl_present:
print("MKL could be found")
else:
print("MKL could NOT be found")
Loading