diff --git a/.travis.yml b/.travis.yml index a0845fd27..afbbe6c82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/qml/representations.py b/qml/representations.py index c2e7f51c4..0e7f63a38 100644 --- a/qml/representations.py +++ b/qml/representations.py @@ -21,6 +21,7 @@ # SOFTWARE. from __future__ import print_function +from __future__ import division import numpy as np @@ -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 @@ -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: diff --git a/setup.py b/setup.py index 37949b3c3..ee3f5d41d 100755 --- a/setup.py +++ b/setup.py @@ -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__ = "andersbiceps@gmail.com" __status__ = "Beta" @@ -95,6 +95,7 @@ def setup_pepytools(): setup( name="qml", + packages=['qml'], # metadata version=__version__, @@ -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, diff --git a/tests/test_wrappers.py b/tests/test_wrappers.py index 388802ea9..b23a059af 100644 --- a/tests/test_wrappers.py +++ b/tests/test_wrappers.py @@ -27,7 +27,7 @@ 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 = [] @@ -35,7 +35,7 @@ def test_arad_wrapper(): 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]