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

Sourcedir #8

Merged
merged 16 commits into from
Jun 9, 2017
18 changes: 5 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,21 @@ install:
- sudo apt-get install -qq gcc gfortran libblas-dev liblapack-dev
- sudo apt-get install -qq gcc-4.8 gfortran-4.8

- echo ${TRAVIS_PYTHON_VERSION}
- |
if [ ${TRAVIS_PYTHON_VERSION:0:1} = 3 ]; then
sudo apt-get install python3-numpy
export PYTHONPATH=/usr/lib/python${TRAVIS_PYTHON_VERSION}/dist-packages:${PYTHONPATH}
# python3 setup.py build
# python3 setup.py install
pip3 install .
python3 setup.py install
elif [ ${TRAVIS_PYTHON_VERSION} = "2.7" ]; then
sudo apt-get install python-numpy
export PYTHONPATH=/usr/lib/python${TRAVIS_PYTHON_VERSION}/dist-packages:${PYTHONPATH}
# python2 setup.py build
# python2 setup.py install
pip2 install .
python2 setup.py install

else
echo "ERROR: Unknown Python version."
fi


before_script:
- cd ${TRAVIS_BUILD_DIR}
- export PYTHONPATH=/usr/local/lib/python${TRAVIS_PYTHON_VERSION}/dist-packages:${PYTHONPATH}
- export PYTHONPATH=/usr/lib/python${TRAVIS_PYTHON_VERSION}/dist-packages:${PYTHONPATH}
- cd ${TRAVIS_BUILD_DIR}/tests/

script:
- nosetests -v tests/*.py
- nosetests -v
8 changes: 5 additions & 3 deletions qml/representations.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# SOFTWARE.

from __future__ import print_function
from __future__ import division

import numpy as np

Expand All @@ -44,7 +45,7 @@ def vector_to_matrix(v):
exit(1)

n = v.shape[0]
l = (-1 + int(np.sqrt(8*n+1)))/2
l = (-1 + int(np.sqrt(8*n+1)))//2
M = np.empty((l,l))

index = 0
Expand Down Expand Up @@ -153,10 +154,11 @@ def generate_bob(coordinates, nuclear_charges, atomtypes, size=23, asize={"O":3,
if atom1 > atom2:
continue
if atom1 == atom2:
size = size1*(size1-1)/2
size = size1*(size1-1)//2
feature_vector = np.zeros(size)
sub_matrix = coulomb_matrix[np.ix_(pos1,pos1)]
feature_vector[:pos1.size*(pos1.size-1)/2] = sub_matrix[np.triu_indices(pos1.size, 1)]
feature_vector[:pos1.size*(pos1.size-1)//2] = sub_matrix[np.triu_indices(pos1.size, 1)]

feature_vector.sort()
descriptor.append(feature_vector[:])
else:
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__copyright__ = "Copyright 2016"
__credits__ = ["Anders S. Christensen (2016) https://github.com/qmlcode/qml"]
__license__ = "MIT"
__version__ = "0.2.11"
__version__ = "0.2.12"
__maintainer__ = "Anders S. Christensen"
__email__ = "[email protected]"
__status__ = "Beta"
Expand Down Expand Up @@ -95,6 +95,7 @@ def setup_pepytools():
setup(

name="qml",
packages=['qml'],

# metadata
version=__version__,
Expand All @@ -103,12 +104,12 @@ def setup_pepytools():
platforms = 'Any',
description = __description__,
long_description = readme(),
keywords = 'Quantum Machine Learning',
keywords = ['Machine Learning', 'Quantum Chemistry'],
classifiers = [],
url = __url__,

# set up package contents
package_dir={'qml': 'qml'},
packages=['qml'],

ext_package = 'qml',
ext_modules = [
ext_farad_kernels,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ def get_energies(filename):
def test_arad_wrapper():

# Parse file containing PBE0/def2-TZVP heats of formation and xyz filenames
data = get_energies("tests/hof_qm7.txt")
data = get_energies("hof_qm7.txt")

# Generate a list of qml.Compound() objects
mols = []

for xyz_file in sorted(data.keys())[:50]:

# Initialize the qml.Compound() objects
mol = qml.Compound(xyz="tests/qm7/" + xyz_file)
mol = qml.Compound(xyz="qm7/" + xyz_file)

# Associate a property (heat of formation) with the object
mol.properties = data[xyz_file]
Expand Down