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

Commit 65886ff

Browse files
authored
Sourcedir (#8)
* fixed bob float/int indices bug (#7) * Changed src/ to qml/ * updated setup install in travis yml * updated pythonpath in travis yml * updated pythonpath in travis yml try 2 * updated pythonpath in travis yml try 3 * updated pythonpath in travis yml try 4 * updated setup.py * removed trusty from travis yml * printing pythonpath in travis yml try 5 * updated pythonpath in travis yml try 5 * updated test path * debug path 1 * updated ext_package * working travis yml
1 parent 15eac68 commit 65886ff

File tree

4 files changed

+17
-22
lines changed

4 files changed

+17
-22
lines changed

.travis.yml

+5-13
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,21 @@ install:
1616
- sudo apt-get install -qq gcc gfortran libblas-dev liblapack-dev
1717
- sudo apt-get install -qq gcc-4.8 gfortran-4.8
1818

19-
- echo ${TRAVIS_PYTHON_VERSION}
2019
- |
2120
if [ ${TRAVIS_PYTHON_VERSION:0:1} = 3 ]; then
2221
sudo apt-get install python3-numpy
23-
export PYTHONPATH=/usr/lib/python${TRAVIS_PYTHON_VERSION}/dist-packages:${PYTHONPATH}
24-
# python3 setup.py build
25-
# python3 setup.py install
26-
pip3 install .
22+
python3 setup.py install
2723
elif [ ${TRAVIS_PYTHON_VERSION} = "2.7" ]; then
2824
sudo apt-get install python-numpy
29-
export PYTHONPATH=/usr/lib/python${TRAVIS_PYTHON_VERSION}/dist-packages:${PYTHONPATH}
30-
# python2 setup.py build
31-
# python2 setup.py install
32-
pip2 install .
25+
python2 setup.py install
26+
3327
else
3428
echo "ERROR: Unknown Python version."
3529
fi
3630
3731
3832
before_script:
39-
- cd ${TRAVIS_BUILD_DIR}
40-
- export PYTHONPATH=/usr/local/lib/python${TRAVIS_PYTHON_VERSION}/dist-packages:${PYTHONPATH}
41-
- export PYTHONPATH=/usr/lib/python${TRAVIS_PYTHON_VERSION}/dist-packages:${PYTHONPATH}
33+
- cd ${TRAVIS_BUILD_DIR}/tests/
4234

4335
script:
44-
- nosetests -v tests/*.py
36+
- nosetests -v

qml/representations.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# SOFTWARE.
2222

2323
from __future__ import print_function
24+
from __future__ import division
2425

2526
import numpy as np
2627

@@ -44,7 +45,7 @@ def vector_to_matrix(v):
4445
exit(1)
4546

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

5051
index = 0
@@ -153,10 +154,11 @@ def generate_bob(coordinates, nuclear_charges, atomtypes, size=23, asize={"O":3,
153154
if atom1 > atom2:
154155
continue
155156
if atom1 == atom2:
156-
size = size1*(size1-1)/2
157+
size = size1*(size1-1)//2
157158
feature_vector = np.zeros(size)
158159
sub_matrix = coulomb_matrix[np.ix_(pos1,pos1)]
159-
feature_vector[:pos1.size*(pos1.size-1)/2] = sub_matrix[np.triu_indices(pos1.size, 1)]
160+
feature_vector[:pos1.size*(pos1.size-1)//2] = sub_matrix[np.triu_indices(pos1.size, 1)]
161+
160162
feature_vector.sort()
161163
descriptor.append(feature_vector[:])
162164
else:

setup.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
__copyright__ = "Copyright 2016"
66
__credits__ = ["Anders S. Christensen (2016) https://github.com/qmlcode/qml"]
77
__license__ = "MIT"
8-
__version__ = "0.2.11"
8+
__version__ = "0.2.12"
99
__maintainer__ = "Anders S. Christensen"
1010
__email__ = "[email protected]"
1111
__status__ = "Beta"
@@ -95,6 +95,7 @@ def setup_pepytools():
9595
setup(
9696

9797
name="qml",
98+
packages=['qml'],
9899

99100
# metadata
100101
version=__version__,
@@ -103,12 +104,12 @@ def setup_pepytools():
103104
platforms = 'Any',
104105
description = __description__,
105106
long_description = readme(),
106-
keywords = 'Quantum Machine Learning',
107+
keywords = ['Machine Learning', 'Quantum Chemistry'],
108+
classifiers = [],
107109
url = __url__,
108110

109111
# set up package contents
110-
package_dir={'qml': 'qml'},
111-
packages=['qml'],
112+
112113
ext_package = 'qml',
113114
ext_modules = [
114115
ext_farad_kernels,

tests/test_wrappers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ def get_energies(filename):
2727
def test_arad_wrapper():
2828

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

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

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

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

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

0 commit comments

Comments
 (0)