Commit 8f501239 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Fixed a bug with unit conversion for velocities.

parent 02900cfc
...@@ -53,7 +53,7 @@ class CP2KInputParser(BasicParser): ...@@ -53,7 +53,7 @@ class CP2KInputParser(BasicParser):
"S": "s", "S": "s",
"FS": "fs", "FS": "fs",
"PS": "ps", "PS": "ps",
"AU_T": "(planckConstant/hartree)", "AU_T": "(hbar/hartree)",
"WAVENUMBER_T": None, "WAVENUMBER_T": None,
} }
......
...@@ -856,7 +856,7 @@ class TestMD(unittest.TestCase): ...@@ -856,7 +856,7 @@ class TestMD(unittest.TestCase):
[0.0012002313, -0.0003701042, 0.0002810523], [0.0012002313, -0.0003701042, 0.0002810523],
[0.0002340810, -0.0003388418, 0.0011398583], [0.0002340810, -0.0003388418, 0.0011398583],
]), ]),
"bohr*(planckConstant/hartree)^-1" "bohr*(hbar/hartree)^-1"
) )
expected_end = convert_unit( expected_end = convert_unit(
np.array([ np.array([
...@@ -867,7 +867,7 @@ class TestMD(unittest.TestCase): ...@@ -867,7 +867,7 @@ class TestMD(unittest.TestCase):
[0.0000307926, 0.0006886719, 0.0008431321], [0.0000307926, 0.0006886719, 0.0008431321],
[0.0007424681, 0.0003614127, 0.0005749089], [0.0007424681, 0.0003614127, 0.0005749089],
]), ]),
"bohr*(planckConstant/hartree)^-1" "bohr*(hbar/hartree)^-1"
) )
self.assertTrue(np.array_equal(result[0,:], expected_start)) self.assertTrue(np.array_equal(result[0,:], expected_start))
...@@ -1034,21 +1034,21 @@ if __name__ == '__main__': ...@@ -1034,21 +1034,21 @@ if __name__ == '__main__':
logger.setLevel(logging.ERROR) logger.setLevel(logging.ERROR)
suites = [] suites = []
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestErrors)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestErrors))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestXCFunctional)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestXCFunctional))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestEnergyForce)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestEnergyForce))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestStressTensorMethods)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestStressTensorMethods))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestSelfInteractionCorrectionMethod)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestSelfInteractionCorrectionMethod))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestConfigurationPeriodicDimensions)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestConfigurationPeriodicDimensions))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestSCFConvergence)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestSCFConvergence))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestForceFiles)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestForceFiles))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestPreprocessor)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestPreprocessor))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOpt)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOpt))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajFormats)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajFormats))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptOptimizers)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptOptimizers))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajectory)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajectory))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMD)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMD))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMDEnsembles)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMDEnsembles))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestElectronicStructureMethod)) suites.append(unittest.TestLoader().loadTestsFromTestCase(TestElectronicStructureMethod))
alltests = unittest.TestSuite(suites) alltests = unittest.TestSuite(suites)
unittest.TextTestRunner(verbosity=0).run(alltests) unittest.TextTestRunner(verbosity=0).run(alltests)
Supports Markdown
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