Commit 22f600e0 authored by Lauri Himanen's avatar Lauri Himanen

Removed unnecessary access of results by index 0 from test cases.

parent 8f501239
......@@ -282,19 +282,19 @@ class TestEnergyForce(unittest.TestCase):
section_basis_set = self.results["section_basis_set"][0]
# Basis name
name = section_basis_set["basis_set_name"][0]
name = section_basis_set["basis_set_name"]
self.assertEqual(name, "DZVP-GTH-PADE_PW_150.0")
# Basis kind
kind = section_basis_set["basis_set_kind"][0]
kind = section_basis_set["basis_set_kind"]
self.assertEqual(kind, "wavefunction")
# Cell dependent basis mapping
cell_basis_mapping = section_basis_set["mapping_section_basis_set_cell_dependent"][0]
cell_basis_mapping = section_basis_set["mapping_section_basis_set_cell_dependent"]
self.assertEqual(cell_basis_mapping, 0)
# # Atom centered basis mapping
atom_basis_mapping = section_basis_set["mapping_section_basis_set_atom_centered"][0]
atom_basis_mapping = section_basis_set["mapping_section_basis_set_atom_centered"]
self.assertTrue(np.array_equal(atom_basis_mapping, np.array(8*[0])))
def test_scf_threshold_energy_change(self):
......@@ -404,26 +404,26 @@ class TestEnergyForce(unittest.TestCase):
def test_section_basis_set_atom_centered(self):
basis = self.results["section_basis_set_atom_centered"][0]
name = basis["basis_set_atom_centered_short_name"][0]
number = basis["basis_set_atom_number"][0]
name = basis["basis_set_atom_centered_short_name"]
number = basis["basis_set_atom_number"]
self.assertEquals(name, "DZVP-GTH-PADE")
self.assertEquals(number, 14)
def test_section_basis_set_cell_dependent(self):
basis = self.results["section_basis_set_cell_dependent"][0]
cutoff = basis["basis_set_planewave_cutoff"][0]
cutoff = basis["basis_set_planewave_cutoff"]
self.assertEquals(cutoff, convert_unit(300.0, "hartree"))
def test_section_method_atom_kind(self):
kind = self.results["section_method_atom_kind"][0]
self.assertEqual(kind["method_atom_kind_atom_number"][0], 14)
self.assertEqual(kind["method_atom_kind_label"][0], "Si")
self.assertEqual(kind["method_atom_kind_atom_number"], 14)
self.assertEqual(kind["method_atom_kind_label"], "Si")
def test_section_method_basis_set(self):
kind = self.results["section_method_basis_set"][0]
self.assertEqual(kind["method_basis_set_kind"][0], "wavefunction")
self.assertEqual(kind["number_of_basis_sets_atom_centered"][0], 1)
self.assertTrue(np.array_equal(kind["mapping_section_method_basis_set_atom_centered"][0], np.array([[0,0]])))
self.assertEqual(kind["method_basis_set_kind"], "wavefunction")
self.assertEqual(kind["number_of_basis_sets_atom_centered"], 1)
self.assertTrue(np.array_equal(kind["mapping_section_method_basis_set_atom_centered"], np.array([[0,0]])))
def test_single_configuration_calculation_converged(self):
result = self.results["single_configuration_calculation_converged"]
......@@ -677,14 +677,14 @@ class TestGeoOptTrajectory(unittest.TestCase):
i_conf = 0
for calc in single_conf.values():
system_index = calc["single_configuration_calculation_to_system_ref"][0]
system_index = calc["single_configuration_calculation_to_system_ref"]
system = systems[system_index]
pos = system["atom_positions"]
if i_conf == 0 or i_conf == 2 or i_conf == 4:
self.assertEqual(pos, None)
else:
pos = system["atom_positions"][0]
pos = system["atom_positions"]
if i_conf == 1:
expected_pos = convert_unit(
np.array([
......
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