summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <55825613+luevano@users.noreply.github.com>2020-02-22 17:12:32 -0700
committerDavid Luevano Alvarado <55825613+luevano@users.noreply.github.com>2020-02-22 17:12:32 -0700
commit8d0a22b9fdef41ece399468423cb533768d0e631 (patch)
treefabb56209abef7561e185f89846d58a8183ac44c
parentfb4307513ddda06742bbe4d542c2716c0d67c06d (diff)
Add tests
-rw-r--r--ml_exp/__main__.py11
-rw-r--r--ml_exp/representations.py4
2 files changed, 12 insertions, 3 deletions
diff --git a/ml_exp/__main__.py b/ml_exp/__main__.py
index 3cb515d85..cb8a9a3f1 100644
--- a/ml_exp/__main__.py
+++ b/ml_exp/__main__.py
@@ -20,5 +20,14 @@ 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 ml_exp.compound import Compound
+
+
if __name__ == '__main__':
- print('Ok!')
+ print('Initialize test')
+ test = []
+ for i in range(1, 10):
+ test.append(Compound(f'/home/luevano/py/ml_exp/data/qm7/000{i}.xyz'))
+ test[i-1].gen_cm(size=1, as_eig=False)
+ test[i-1].gen_ljm(size=1, as_eig=False)
+ test[i-1].gen_am(size=1)
diff --git a/ml_exp/representations.py b/ml_exp/representations.py
index 354611190..ae870f3b0 100644
--- a/ml_exp/representations.py
+++ b/ml_exp/representations.py
@@ -273,9 +273,9 @@ def adjacency_matrix(fnm,
size = n
if forces:
- am = np.empty((size, size), dtype=float)
+ am = np.zeros((size, size), dtype=float)
else:
- am = np.empty((size, size), dtype=int)
+ am = np.zeros((size, size), dtype=int)
for i, bond_i in enumerate(bonds):
for j, bond_j in enumerate(bonds):