Commit 5062fbb1 authored by Mohamed, Fawzi Roberto (fawzi)'s avatar Mohamed, Fawzi Roberto (fawzi)
Browse files

meta 2.0 changes

parent b1b03c89
Pipeline #42641 failed with stage
in 11 minutes and 48 seconds
......@@ -63,7 +63,7 @@ class BigDFTMainParser(AbstractBaseParser):
self.backend.addValue("electronic_structure_method", "DFT")
self.backend.addValue("program_basis_set_type", "real-space grid")
self.backend.addValue("single_configuration_calculation_to_system_ref", section_system_id)
self.backend.addValue("single_configuration_to_calculation_method_ref", section_method_id)
self.backend.addValue("single_configuration_calculation_to_method_ref", section_method_id)
loader = Loader(fin)
generator = self.generate_root_nodes(loader)
......@@ -132,9 +132,9 @@ class BigDFTMainParser(AbstractBaseParser):
energy_change = iteration["D"]
self.backend.addRealValue("energy_total_scf_iteration", etotal, unit="hartree")
if exc is not None:
self.backend.addRealValue("energy_XC_scf_iteration", exc, unit="hartree")
self.backend.addRealValue("energy_xc_scf_iteration", exc, unit="hartree")
if evxc is not None:
self.backend.addRealValue("energy_XC_potential_scf_iteration", evxc, unit="hartree")
self.backend.addRealValue("energy_xc_potential_scf_iteration", evxc, unit="hartree")
self.backend.addRealValue("energy_change_scf_iteration", energy_change, unit="hartree")
self.backend.closeSection("section_scf_iteration", scf_id)
......@@ -189,7 +189,9 @@ class BigDFTMainParser(AbstractBaseParser):
for force in value:
forces.append(*force.values())
forces = np.array(forces)
fId = self.backend.openSection('section_atom_forces')
self.backend.addArrayValues("atom_forces", forces, unit="hartree/bohr")
self.backend.closeSection('section_atom_forces', fId)
def dft_parameters(self, value):
# XC functional
......@@ -259,11 +261,11 @@ class BigDFTMainParser(AbstractBaseParser):
n_names = len(sorted_xc)
for i_name, name in enumerate(sorted_xc):
weight = 1.0
xc_id = self.backend.openSection("section_XC_functionals")
self.backend.addValue("XC_functional_name", name)
self.backend.addValue("XC_functional_weight", weight)
self.backend.closeSection("section_XC_functionals", xc_id)
xc_id = self.backend.openSection("section_xc_functionals")
self.backend.addValue("xc_functional_name", name)
self.backend.addValue("xc_functional_weight", weight)
self.backend.closeSection("section_xc_functionals", xc_id)
summary += "{}*{}".format(weight, name)
if i_name+1 != n_names:
summary += "_"
self.backend.addValue("XC_functional", summary)
self.backend.addValue("xc_functional", summary)
......@@ -76,7 +76,7 @@ class TestSinglePoint(unittest.TestCase):
self.assertTrue(np.array_equal(result, np.array([False, False, False])))
def test_xc_functional(self):
result = self.results["XC_functional"]
result = self.results["xc_functional"]
self.assertEqual(result, "1.0*LDA_XC_TETER93")
def test_atom_labels(self):
......@@ -153,7 +153,7 @@ class TestSinglePoint(unittest.TestCase):
self.assertEqual(result, 11)
def test_single_configuration_to_calculation_method_ref(self):
result = self.results["single_configuration_to_calculation_method_ref"]
result = self.results["single_configuration_calculation_to_method_ref"]
self.assertEqual(result, 0)
def test_single_configuration_calculation_to_system_description_ref(self):
......@@ -194,72 +194,72 @@ class TestXCFunctionals(unittest.TestCase):
"""
def test_abinit_1(self):
results = get_result("xc_functionals/abinit_1")
result = results["XC_functional"]
result = results["xc_functional"]
self.assertEqual(result, "1.0*LDA_XC_TETER93")
def test_abinit_11(self):
results = get_result("xc_functionals/abinit_11")
result = results["XC_functional"]
result = results["xc_functional"]
self.assertEqual(result, "1.0*GGA_C_PBE_1.0*GGA_X_PBE")
def test_abinit_12(self):
results = get_result("xc_functionals/abinit_12")
result = results["XC_functional"]
result = results["xc_functional"]
self.assertEqual(result, "1.0*GGA_X_PBE")
# YAML parse error
# def test_abinit_15(self):
# results = get_results("xc_functionals/abinit_15")
# result = results["XC_functional"]
# result = results["xc_functional"]
# self.assertEqual(result, "1.0*GGA_C_PBE_1.0*GGA_X_RPBE")
# Error
# def test_abinit_16(self):
# results = get_results("xc_functionals/abinit_16")
# result = results["XC_functional"]
# result = results["xc_functional"]
# self.assertEqual(result, "1.0*GGA_XC_HCTH_93")
# Error
# def test_abinit_17(self):
# results = get_results("xc_functionals/abinit_17")
# result = results["XC_functional"]
# result = results["xc_functional"]
# self.assertEqual(result, "1.0*GGA_XC_HCTH_120")
# Error
# def test_abinit_26(self):
# results = get_results("xc_functionals/abinit_26")
# result = results["XC_functional"]
# result = results["xc_functional"]
# self.assertEqual(result, "1.0*GGA_XC_HCTH_147")
# Error
# def test_abinit_27(self):
# results = get_results("xc_functionals/abinit_27")
# result = results["XC_functional"]
# result = results["xc_functional"]
# self.assertEqual(result, "1.0*GGA_XC_HCTH_407")
def test_abinit_100(self):
results = get_result("xc_functionals/abinit_100")
result = results["XC_functional"]
result = results["xc_functional"]
self.assertEqual(result, "1.0*HF_X")
def test_libxc_001(self):
results = get_result("xc_functionals/libxc_001")
result = results["XC_functional"]
result = results["xc_functional"]
self.assertEqual(result, "1.0*LDA_X")
def test_libxc_010(self):
results = get_result("xc_functionals/libxc_010")
result = results["XC_functional"]
result = results["xc_functional"]
self.assertEqual(result, "1.0*LDA_C_PZ_MOD")
def test_libxc_101(self):
results = get_result("xc_functionals/libxc_101")
result = results["XC_functional"]
result = results["xc_functional"]
self.assertEqual(result, "1.0*GGA_X_PBE")
def test_libxc_101130(self):
results = get_result("xc_functionals/libxc_101130")
result = results["XC_functional"]
result = results["xc_functional"]
self.assertEqual(result, "1.0*GGA_C_PBE_1.0*GGA_X_PBE")
......
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