Commit 7dc9a136 authored by eric pellegrini's avatar eric pellegrini
Browse files

remove functional tests

bug fix with rbt analysis
parent a005e633
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestDP(UnitTest):
def test(self):
parameters = {}
parameters['atom_selection'] = 'all'
parameters['atom_transmutation'] = None
parameters['axis'] = 'c'
parameters['dr'] = 0.01
parameters['frames'] = (0, 10, 1)
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['running_mode'] = ('monoprocessor', 1)
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/waterbox_in_periodic_universe.nc'
parameters['weights'] = 'equal'
job = REGISTRY['job']['dp']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestDP))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestECC(UnitTest):
def test(self):
parameters = {}
parameters['atom_selection'] = 'all'
parameters['center_of_mass'] = 'all'
parameters['frames'] = (0, 10, 1)
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/waterbox_in_periodic_universe.nc'
parameters['weights'] = 'equal'
job = REGISTRY['job']['ecc']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestECC))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestEISF(UnitTest):
def test(self):
parameters = {}
parameters['atom_selection'] = 'all'
parameters['atom_transmutation'] = None
parameters['frames'] = (0, 10, 1)
parameters['grouping_level'] = 'atom'
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['projection'] = None
parameters['q_vectors'] = ('spherical_lattice', {'width': 0.1, 'n_vectors': 50, 'shells': (0.1, 5, 0.1)})
parameters['running_mode'] = ('monoprocessor', 1)
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/waterbox_in_periodic_universe.nc'
parameters['weights'] = 'b_incoherent'
job = REGISTRY['job']['eisf']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestEISF))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestFORCITE(UnitTest):
def test(self):
parameters = {}
parameters['output_file'] = ('/tmp/output', ['netcdf'])
parameters['trj_file'] = '../../../Data/Trajectories/Forcite/nylon66_rho100_500K_v300K.trj'
parameters['xtd_file'] = '../../../Data/Trajectories/Forcite/nylon66_rho100_500K_v300K.xtd'
job = REGISTRY['job']['forcite']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestFORCITE))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestGACF(UnitTest):
def test(self):
parameters = {}
parameters['atom_selection'] = 'all'
parameters['atom_transmutation'] = None
parameters['frames'] = (0, 10, 1)
parameters['grouping_level'] = 'atom'
parameters['normalize'] = False
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['running_mode'] = ('monoprocessor', 1)
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/waterbox_in_periodic_universe.nc'
parameters['trajectory_variable'] = 'velocities'
parameters['weights'] = 'equal'
job = REGISTRY['job']['gacf']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestGACF))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestGDISF(UnitTest):
def test(self):
parameters = {}
parameters['atom_selection'] = 'all'
parameters['atom_transmutation'] = None
parameters['frames'] = (0, 10, 1)
parameters['grouping_level'] = 'atom'
parameters['instrument_resolution'] = ('gaussian', {'mu': 0.0, 'sigma': 10.0})
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['projection'] = None
parameters['q_shells'] = (0, 10, 1)
parameters['running_mode'] = ('monoprocessor', 1)
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/waterbox_in_periodic_universe.nc'
parameters['weights'] = 'b_incoherent2'
job = REGISTRY['job']['gdisf']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestGDISF))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestGENERIC(UnitTest):
def test(self):
parameters = {}
parameters['gt_file'] = '../../../Data/Trajectories/Generic/test.gtf'
parameters['output_file'] = ('/tmp/output', ['netcdf'])
job = REGISTRY['job']['generic']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestGENERIC))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestGMFT(UnitTest):
def test(self):
parameters = {}
parameters['atom_selection'] = 'all'
parameters['contiguous'] = False
parameters['frames'] = (0, 10, 1)
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['reference_selection'] = 'all'
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/waterbox_in_periodic_universe.nc'
job = REGISTRY['job']['gmft']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestGMFT))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestLAMMPS(UnitTest):
def test(self):
parameters = {}
parameters['config_file'] = '../../../Data/Trajectories/LAMMPS/glycyl_L_alanine_charmm.config'
parameters['n_steps'] = 1
parameters['output_file'] = ('/tmp/output', ['netcdf'])
parameters['time_step'] = 1.0
parameters['trajectory_file'] = '../../../Data/Trajectories/LAMMPS/glycyl_L_alanine_charmm.lammps'
job = REGISTRY['job']['lammps']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestLAMMPS))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestMSD(UnitTest):
def test(self):
parameters = {}
parameters['atom_selection'] = 'all'
parameters['atom_transmutation'] = None
parameters['frames'] = (0, 10, 1)
parameters['grouping_level'] = 'atom'
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['projection'] = None
parameters['running_mode'] = ('monoprocessor', 1)
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/waterbox_in_periodic_universe.nc'
parameters['weights'] = 'equal'
job = REGISTRY['job']['msd']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestMSD))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestMT(UnitTest):
def test(self):
parameters = {}
parameters['atom_selection'] = 'all'
parameters['frames'] = (0, 10, 1)
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['running_mode'] = ('monoprocessor', 1)
parameters['spatial_resolution'] = 0.1
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/waterbox_in_periodic_universe.nc'
job = REGISTRY['job']['mt']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestMT))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestMVI(UnitTest):
def test(self):
parameters = {}
parameters['display'] = False
parameters['frames'] = (0, 10, 1)
parameters['instrument'] = '../../../Data/McStas/Instruments/Simple_ToF_Flat_Sample.out'
parameters['options'] = {'ncount': 10000, 'dir': '/tmp/mcstas_output/27.01.2016-14:49:51'}
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['parameters'] = {'beam_wavelength_Angs': 2.0, 'container_thickness_m': 5e-05, 'environment_radius_m': 0.025, 'sample_detector_distance_m': 4.0, 'container': '/home/pellegrini/git/mdanse/Data/McStas/Samples/Al.laz', 'environment_thickness_m': 0.002, 'detector_height_m': 3.0, 'beam_resolution_meV': 0.1, 'sample_height_m': 0.05, 'sample_thickness_m': 0.001, 'environment': '/home/pellegrini/git/mdanse/Data/McStas/Samples/Al.laz', 'sample_width_m': 0.02, 'sample_rotation_deg': 45.0}
parameters['sample_coh'] = '../../../Data/NetCDF/dcsf_prot.nc'
parameters['sample_inc'] = '../../../Data/NetCDF/disf_prot.nc'
parameters['temperature'] = 298.0
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/protein_in_periodic_universe.nc'
job = REGISTRY['job']['mvi']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestMVI))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestNAMD(UnitTest):
def test(self):
parameters = {}
parameters['dcd_file'] = '../../../Data/Trajectories/CHARMM/2vb1.dcd'
parameters['fold'] = False
parameters['output_file'] = ('/tmp/output', ['netcdf'])
parameters['pdb_file'] = '../../../Data/Trajectories/CHARMM/2vb1.pdb'
job = REGISTRY['job']['namd']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestNAMD))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestOP(UnitTest):
def test(self):
parameters = {}
parameters['axis_selection'] = ('C284H438N84O79S7', ('C', 'C_beta'))
parameters['frames'] = (0, 10, 1)
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['per_axis'] = False
parameters['reference_direction'] = [0, 0, 1]
parameters['running_mode'] = ('monoprocessor', 1)
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/protein_in_periodic_universe.nc'
job = REGISTRY['job']['op']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestOP))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestPACF(UnitTest):
def test(self):
parameters = {}
parameters['atom_selection'] = 'all'
parameters['atom_transmutation'] = None
parameters['frames'] = (0, 10, 1)
parameters['grouping_level'] = 'atom'
parameters['normalize'] = False
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['projection'] = None
parameters['running_mode'] = ('monoprocessor', 1)
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/waterbox_in_periodic_universe.nc'
parameters['weights'] = 'equal'
job = REGISTRY['job']['pacf']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestPACF))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestPDB(UnitTest):
def test(self):
parameters = {}
parameters['nb_frame'] = (0, 2, 1)
parameters['output_file'] = ('/tmp/output', ['netcdf'])
parameters['pdb_file'] = '../../../Data/Trajectories/PDB/2f58_nma.pdb'
parameters['time_step'] = 1.0
job = REGISTRY['job']['pdb']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestPDB))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestPDF(UnitTest):
def test(self):
parameters = {}
parameters['atom_selection'] = 'all'
parameters['atom_transmutation'] = None
parameters['frames'] = (0, 10, 1)
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['r_values'] = (0, 10, 1)
parameters['running_mode'] = ('monoprocessor', 1)
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/waterbox_in_periodic_universe.nc'
parameters['weights'] = 'equal'
job = REGISTRY['job']['pdf']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestPDF))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestRBT(UnitTest):
def test(self):
parameters = {}
parameters['atom_selection'] = 'all'
parameters['frames'] = (0, 10, 1)
parameters['grouping_level'] = 'atom'
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['reference'] = 0
parameters['remove_translation'] = False
parameters['running_mode'] = ('monoprocessor', 1)
parameters['stepwise'] = True
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/waterbox_in_periodic_universe.nc'
job = REGISTRY['job']['rbt']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestRBT))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestRMSD(UnitTest):
def test(self):
parameters = {}
parameters['atom_selection'] = 'all'
parameters['atom_transmutation'] = None
parameters['frames'] = (0, 10, 1)
parameters['grouping_level'] = 'atom'
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['reference_frame'] = 0
parameters['running_mode'] = ('monoprocessor', 1)
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/waterbox_in_periodic_universe.nc'
parameters['weights'] = 'equal'
job = REGISTRY['job']['rmsd']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestRMSD))
return s
if __name__ == '__main__':
unittest.main(verbosity=2)
#!/usr/bin/python
import unittest
from Tests.UnitTests.UnitTest import UnitTest
from MDANSE import REGISTRY
class TestRMSF(UnitTest):
def test(self):
parameters = {}
parameters['atom_selection'] = 'all'
parameters['frames'] = (0, 10, 1)
parameters['grouping_level'] = 'atom'
parameters['output_files'] = ('/tmp/output', ['netcdf'])
parameters['running_mode'] = ('monoprocessor', 1)
parameters['trajectory'] = '../../../Data/Trajectories/MMTK/waterbox_in_periodic_universe.nc'
job = REGISTRY['job']['rmsf']()
self.assertNotRaises(job.run, parameters, status=False)
def suite():
loader = unittest.TestLoader()
s = unittest.TestSuite()
s.addTest(loader.loadTestsFromTestCase(TestRMSF))
return s