Skip to content

Commit c576539

Browse files
andersxlarsbratholm
authored andcommitted
Remove ase and dataprovider (qmlcode#108)
* removed old dataprovider and ASE requirements * Updated test for relocated compond
1 parent ff910f4 commit c576539

18 files changed

+20
-138
lines changed

qml/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"""
3333
from __future__ import absolute_import
3434

35-
from . import data
3635
from . import models
3736
from . import aglaia
3837
from . import math
@@ -42,6 +41,7 @@
4241
from . import representations
4342
from . import qmlearn
4443
from . import utils
44+
from .utils.compound import Compound
4545

4646
__author__ = "Anders S. Christensen"
4747
__copyright__ = "Copyright 2016"

qml/aglaia/aglaia.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from qml.representations import generate_acsf
4141
from qml.aglaia.graceful_killer import _GracefulKiller
4242

43-
from qml.data import Compound
43+
from qml import Compound
4444
from qml import representations as qml_rep
4545

4646
import tensorflow

qml/data/__init__.py

-25
This file was deleted.

qml/data/dataprovider.py

-46
This file was deleted.

qml/data/xyzdataprovider.py

-42
This file was deleted.
File renamed without changes.

requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
numpy>=1.13
22
scipy
33
scikit-learn
4-
ase
54
six

setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ def setup_qml():
144144
name="qml",
145145
packages=[
146146
'qml',
147-
'qml.data',
148147
'qml.aglaia',
149148
'qml.arad',
150149
'qml.fchl',

test/test_arad.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_arad():
7272
for xyz_file in sorted(data.keys())[:10]:
7373

7474
# Initialize the qml.data.Compound() objects
75-
mol = qml.data.Compound(xyz=test_dir + "/qm7/" + xyz_file)
75+
mol = qml.Compound(xyz=test_dir + "/qm7/" + xyz_file)
7676

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

test/test_compound.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import os
2626

27-
from qml.data import Compound
27+
from qml import Compound
2828
import numpy as np
2929

3030
def compare_lists(a, b):

test/test_energy_krr_atomic_cmat.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import numpy as np
2727

2828
import qml
29-
import qml.data
3029

3130
from qml.kernels import laplacian_kernel
3231
from qml.math import cho_solve
@@ -65,14 +64,14 @@ def test_krr_gaussian_local_cmat():
6564
# Parse file containing PBE0/def2-TZVP heats of formation and xyz filenames
6665
data = get_energies(test_dir + "/data/hof_qm7.txt")
6766

68-
# Generate a list of qml.data.Compound() objects"
67+
# Generate a list of qml.Compound() objects"
6968
mols = []
7069

7170

7271
for xyz_file in sorted(data.keys())[:1000]:
7372

74-
# Initialize the qml.data.Compound() objects
75-
mol = qml.data.Compound(xyz=test_dir + "/qm7/" + xyz_file)
73+
# Initialize the qml.Compound() objects
74+
mol = qml.Compound(xyz=test_dir + "/qm7/" + xyz_file)
7675

7776
# Associate a property (heat of formation) with the object
7877
mol.properties = data[xyz_file]
@@ -152,8 +151,8 @@ def test_krr_laplacian_local_cmat():
152151

153152
for xyz_file in sorted(data.keys())[:1000]:
154153

155-
# Initialize the qml.data.Compound() objects
156-
mol = qml.data.Compound(xyz=test_dir + "/qm7/" + xyz_file)
154+
# Initialize the qml.Compound() objects
155+
mol = qml.Compound(xyz=test_dir + "/qm7/" + xyz_file)
157156

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

test/test_energy_krr_bob.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import numpy as np
2727

2828
import qml
29-
import qml.data
3029

3130
from qml.kernels import laplacian_kernel
3231
from qml.math import cho_solve
@@ -65,8 +64,8 @@ def test_krr_bob():
6564

6665
for xyz_file in sorted(data.keys())[:1000]:
6766

68-
# Initialize the qml.data.Compound() objects
69-
mol = qml.data.Compound(xyz=test_dir + "/qm7/" + xyz_file)
67+
# Initialize the qml.Compound() objects
68+
mol = qml.Compound(xyz=test_dir + "/qm7/" + xyz_file)
7069

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

test/test_energy_krr_cmat.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import numpy as np
2727

2828
import qml
29-
import qml.data
3029

3130
from qml.kernels import laplacian_kernel
3231
from qml.math import cho_solve
@@ -65,8 +64,8 @@ def test_krr_cmat():
6564

6665
for xyz_file in sorted(data.keys())[:1000]:
6766

68-
# Initialize the qml.data.Compound() objects
69-
mol = qml.data.Compound(xyz=test_dir + "/qm7/" + xyz_file)
67+
# Initialize the qml.Compound() objects
68+
mol = qml.Compound(xyz=test_dir + "/qm7/" + xyz_file)
7069

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

test/test_fchl_scalar.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from scipy.special import binom
3232
from scipy.special import factorial
3333

34-
from qml.data import Compound
34+
from qml import Compound
3535

3636
from qml.math import cho_solve
3737

test/test_kernels.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def test_kpca():
261261
# Parse file containing PBE0/def2-TZVP heats of formation and xyz filenam
262262
data = get_energies(test_dir + "/data/hof_qm7.txt")
263263

264-
# Generate a list of qml.data.Compound() objects
264+
# Generate a list of qml.Compound() objects
265265
mols = []
266266

267267
keys = sorted(data.keys())
@@ -273,7 +273,7 @@ def test_kpca():
273273

274274
for xyz_file in keys[:n_mols]:
275275

276-
mol = qml.data.Compound(xyz=test_dir + "/qm7/" + xyz_file)
276+
mol = qml.Compound(xyz=test_dir + "/qm7/" + xyz_file)
277277
mol.properties = data[xyz_file]
278278
mol.generate_bob()
279279
mols.append(mol)

test/test_representations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_representations():
5858

5959
mols = []
6060
for xyz_file in files:
61-
mol = qml.data.Compound(xyz=path + "/" + xyz_file)
61+
mol = qml.Compound(xyz=path + "/" + xyz_file)
6262
mols.append(mol)
6363

6464
size = max(mol.nuclear_charges.size for mol in mols) + 1

test/test_slatm.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_slatm_global_representation():
4646
mols = []
4747
for xyz_file in files:
4848

49-
mol = qml.data.Compound(xyz=path + "/" + xyz_file)
49+
mol = qml.Compound(xyz=path + "/" + xyz_file)
5050
mols.append(mol)
5151

5252
mbtypes = get_slatm_mbtypes(np.array([mol.nuclear_charges for mol in mols]))
@@ -79,7 +79,7 @@ def test_slatm_local_representation():
7979
mols = []
8080
for xyz_file in files:
8181

82-
mol = qml.data.Compound(xyz=path + "/" + xyz_file)
82+
mol = qml.Compound(xyz=path + "/" + xyz_file)
8383
mols.append(mol)
8484

8585
mbtypes = get_slatm_mbtypes(np.array([mol.nuclear_charges for mol in mols]))

test/test_symm_funct.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def test_acsf():
6767

6868
mols = []
6969
for xyz_file in files:
70-
mol = qml.data.Compound(xyz=path + "/" + xyz_file)
70+
mol = qml.Compound(xyz=path + "/" + xyz_file)
7171
mols.append(mol)
7272

7373
elements = set()

0 commit comments

Comments
 (0)