Unverified Commit c2517397 authored by Ignacio Pickering's avatar Ignacio Pickering Committed by GitHub
Browse files

Cleanup tests (#487)

* cleanup after test_vibrational to avoid .pckl files everywhere

* only dump test_neurochem's runs into torchani/tests

* avoid runs inside tests/

* Add coverage to gitignore

* consts is unnecessary here
parent 356ccaa2
...@@ -15,7 +15,7 @@ benchmark_xyz ...@@ -15,7 +15,7 @@ benchmark_xyz
*.pyc *.pyc
*checkpoint* *checkpoint*
*.pt *.pt
/runs /tests/runs
/quicktest.py /quicktest.py
/*.ipt /*.ipt
/*.params /*.params
...@@ -39,3 +39,5 @@ dist ...@@ -39,3 +39,5 @@ dist
Untitled.ipynb Untitled.ipynb
/nnp_training.py /nnp_training.py
/test*.py /test*.py
.coverage
htmlcov/
...@@ -7,7 +7,6 @@ path = os.path.dirname(os.path.realpath(__file__)) ...@@ -7,7 +7,6 @@ path = os.path.dirname(os.path.realpath(__file__))
dataset_path = os.path.join(path, '../dataset/ani-1x/sample.h5') dataset_path = os.path.join(path, '../dataset/ani-1x/sample.h5')
batch_size = 256 batch_size = 256
ani1x = torchani.models.ANI1x() ani1x = torchani.models.ANI1x()
consts = ani1x.consts
sae_dict = ani1x.sae_dict sae_dict = ani1x.sae_dict
aev_computer = ani1x.aev_computer aev_computer = ani1x.aev_computer
......
...@@ -13,7 +13,7 @@ class TestNeuroChem(unittest.TestCase): ...@@ -13,7 +13,7 @@ class TestNeuroChem(unittest.TestCase):
def testNeuroChemTrainer(self): def testNeuroChemTrainer(self):
d = torch.device('cpu') d = torch.device('cpu')
trainer = torchani.neurochem.Trainer(iptpath, d, True, 'runs') trainer = torchani.neurochem.Trainer(iptpath, d, True, os.path.join(path, 'runs'))
# test if loader construct correct model # test if loader construct correct model
self.assertEqual(trainer.aev_computer.aev_length, 384) self.assertEqual(trainer.aev_computer.aev_length, 384)
......
...@@ -34,6 +34,7 @@ class TestVibrational(unittest.TestCase): ...@@ -34,6 +34,7 @@ class TestVibrational(unittest.TestCase):
modes = [] modes = []
for j in range(6, 6 + len(freq)): for j in range(6, 6 + len(freq)):
modes.append(vib.get_mode(j)) modes.append(vib.get_mode(j))
vib.clean()
modes = torch.tensor(modes) modes = torch.tensor(modes)
# compute vibrational by torchani # compute vibrational by torchani
species = model.species_to_tensor(molecule.get_chemical_symbols()).unsqueeze(0) species = model.species_to_tensor(molecule.get_chemical_symbols()).unsqueeze(0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment