diff --git a/parser/parser-cpmd/cpmdparser/regtest/cpmd_4.1/run_tests.py b/parser/parser-cpmd/cpmdparser/regtest/cpmd_4.1/run_tests.py index 4e14328b0d9b8e19450516a28202e4eabdc91d85..4bc44d0c777a60407b6f710bf18d27a9a316718a 100644 --- a/parser/parser-cpmd/cpmdparser/regtest/cpmd_4.1/run_tests.py +++ b/parser/parser-cpmd/cpmdparser/regtest/cpmd_4.1/run_tests.py @@ -216,7 +216,7 @@ class TestSinglePoint(unittest.TestCase): def test_section_method_basis_set(self): kind = self.results["section_method_basis_set"][0] self.assertEqual(kind["method_basis_set_kind"], "wavefunction") - self.assertTrue(np.array_equal(kind["mapping_section_method_basis_set_cell_associated"], 0)) + self.assertTrue(np.array_equal(kind["mapping_section_method_basis_set_cell_dependent"], 0)) def test_single_configuration_to_calculation_method_ref(self): result = self.results["single_configuration_to_calculation_method_ref"] @@ -246,6 +246,10 @@ class TestGeoOpt(unittest.TestCase): def setUpClass(cls): cls.results = get_results("geo_opt/bfgs", "section_run") + def test_program_name(self): + result = self.results["program_name"] + self.assertEqual(result, "CPMD") + def test_sampling_method(self): result = self.results["sampling_method"] self.assertEqual(result, "geometry_optimization") @@ -260,7 +264,7 @@ class TestGeoOpt(unittest.TestCase): def test_single_configuration_calculation_to_system_ref(self): result = self.results["section_single_configuration_calculation"] - for i_scc, scc in enumerate(result.values()): + for i_scc, scc in enumerate(result): self.assertEqual(scc["single_configuration_to_calculation_method_ref"], 0) self.assertEqual(scc["single_configuration_calculation_to_system_ref"], i_scc) @@ -401,6 +405,10 @@ class TestMD(unittest.TestCase): "hartree" ) + def test_program_name(self): + result = self.results["program_name"] + self.assertEqual(result, "CPMD") + def test_number_of_atoms(self): result = self.results["number_of_atoms"] expected_result = np.array(5*[2]) @@ -495,7 +503,7 @@ class TestMD(unittest.TestCase): def test_single_configuration_calculation_to_system_ref(self): result = self.results["section_single_configuration_calculation"] - for i_scc, scc in enumerate(result.values()): + for i_scc, scc in enumerate(result): self.assertEqual(scc["single_configuration_to_calculation_method_ref"], 0) self.assertEqual(scc["single_configuration_calculation_to_system_ref"], i_scc) @@ -646,12 +654,12 @@ class TestMDPrintSettings(unittest.TestCase): sccs = results["section_single_configuration_calculation"] systems = results["section_system"] - for i_scc, scc in sccs.items(): + for i_scc, scc in enumerate(sccs): ref = scc["single_configuration_calculation_to_system_ref"] system = systems[ref] - pos = system["atom_positions"] - vel = system["atom_velocities"] - forces = scc["atom_forces"] + pos = system.get("atom_positions") + vel = system.get("atom_velocities") + forces = scc.get("atom_forces") if i_scc % 3 == 0: pass self.assertFalse(pos is None) diff --git a/parser/parser-cpmd/cpmdparser/versions/cpmd41/commonparser.py b/parser/parser-cpmd/cpmdparser/versions/cpmd41/commonparser.py index f151bb29c06ac802e4f1df12249f760aa9430c9e..f86b5aa0a994e820fc7ad2d5f0950ee8ee17ab23 100644 --- a/parser/parser-cpmd/cpmdparser/versions/cpmd41/commonparser.py +++ b/parser/parser-cpmd/cpmdparser/versions/cpmd41/commonparser.py @@ -237,7 +237,7 @@ class CPMDCommonParser(CommonParser): backend.addValue("electronic_structure_method", "DFT") basis_id = backend.openSection("section_method_basis_set") backend.addValue("method_basis_set_kind", "wavefunction") - backend.addValue("mapping_section_method_basis_set_cell_associated", 0) + backend.addValue("mapping_section_method_basis_set_cell_dependent", 0) backend.closeSection("section_method_basis_set", basis_id) def onClose_x_cpmd_section_atom_kind(self, backend, gIndex, section):