Repository: JuDFTteam/masci-tools

Issue:
Changes to the output of the outxml_parser
Up till now the output of the outxml_parser tries to mirror the current status of the hardcoded parser in aiida-fleur as closely as possible. Here we collect things that should be added/modified in the output. Feel free to add to this list

- The normal distance output is named `charge_density`. Maybe not the most telling name (alternative `density_convergence` for example)
- The names for the relax output are also not optimal (some are formatted containing the atomtype, maybe a list is more useful); also see https://github.com/JuDFTteam/aiida-fleur/issues/101
- Add some quality criterions of calculations (lostElectrons, ...)
- Some calculation modes are missing for newer fleur versions (Hubbard1, greensfunction, ...)

Discussion:

Patch:
diff --git a/masci_tools/io/parsers/fleur/default_parse_tasks.py b/masci_tools/io/parsers/fleur/default_parse_tasks.py
index fc3f4883..44840b81 100644
--- a/masci_tools/io/parsers/fleur/default_parse_tasks.py
+++ b/masci_tools/io/parsers/fleur/default_parse_tasks.py
@@ -119,6 +119,13 @@ TASKS_DEFINITION = {
                 'name': 'band'
             }
         },
+        'bz_integration': {
+            'parse_type': 'attrib',
+            'path_spec': {
+                'name': 'mode',
+                'tag_name': 'bzIntegration'
+            }
+        }
     },
     #--------Defintions for general info from outfile (start, endtime, number_iterations)--------
     'general_out_info': {
@@ -138,12 +145,6 @@ TASKS_DEFINITION = {
                 'name': 'targetComputerArchitectures'
             }
         },
-        'creator_target_structure': {
-            'parse_type': 'text',
-            'path_spec': {
-                'name': 'targetStructureClass'
-            }
-        },
         'output_file_version': {
             'parse_type': 'attrib',
             'path_spec': {
@@ -168,6 +169,13 @@ TASKS_DEFINITION = {
                 'name': 'ntype'
             }
         },
+        'number_of_kpoints': {
+            'parse_type': 'attrib',
+            'path_spec': {
+                'name': 'count',
+                'contains': 'numericalParameters'
+            }
+        },
         'start_date': {
             'parse_type': 'allAttribs',
             'path_spec': {
@@ -387,7 +395,7 @@ TASKS_DEFINITION = {
     },
     'distances': {
         '_minimal': True,
-        'charge_density': {
+        'density_convergence': {
             'parse_type': 'attrib',
             'path_spec': {
                 'name': 'distance',
@@ -406,14 +414,14 @@ TASKS_DEFINITION = {
     'magnetic_distances': {
         '_minimal': True,
         '_modes': [('jspin', 2)],
-        'overall_charge_density': {
+        'overall_density_convergence': {
             'parse_type': 'attrib',
             'path_spec': {
                 'name': 'distance',
                 'tag_name': 'overallChargeDensity'
             }
         },
-        'spin_density': {
+        'spin_density_convergence': {
             'parse_type': 'attrib',
             'path_spec': {
                 'name': 'distance',
@@ -484,6 +492,7 @@ TASKS_DEFINITION = {
         }
     },
     'bandgap': {
+        '_modes': [('bz_integration', 'hist')],
         'bandgap': {
             'parse_type': 'singleValue',
             'path_spec': {
@@ -514,6 +523,7 @@ TASKS_DEFINITION = {
         }
     },
     'forces': {
+        '_minimal': True,
         '_modes': [('relax', True)],
         '_conversions': ['convert_forces'],
         'force_units': {
diff --git a/masci_tools/io/parsers/fleur/fleur_outxml_parser.py b/masci_tools/io/parsers/fleur/fleur_outxml_parser.py
index 5c69c220..5b902ffe 100644
--- a/masci_tools/io/parsers/fleur/fleur_outxml_parser.py
+++ b/masci_tools/io/parsers/fleur/fleur_outxml_parser.py
@@ -61,7 +61,7 @@ def outxml_parser(outxmlfile, version=None, parser_info_out=None, iteration_to_p
     if parser_info_out is None:
         parser_info_out = {'parser_warnings': [], 'fleur_modes': {}, 'debug_info': {}}
 
-    parser_version = '0.3.0'
+    parser_version = '0.4.0'
     parser_info_out['parser_info'] = f'Masci-Tools Fleur out.xml Parser v{parser_version}'
 
     outfile_broken = False
@@ -309,7 +309,9 @@ def parse_general_information(root, parser, outschema_dict, iteration_to_parse=N
 
     #For certain fleur modes we need to overwrite the tasks
     if fleurmode['dos'] or fleurmode['band']:
-        parser.iteration_tasks = ['iteration_number', 'fermi_energy', 'bandgap']
+        parser.iteration_tasks = ['iteration_number', 'fermi_energy']
+        if fleurmode['bz_integration'] == 'hist':
+            parser.iteration_tasks = ['iteration_number', 'fermi_energy', 'bandgap']
 
     if fleurmode['relax'] and iteration_to_parse == 'last':
         if 'distances' in parser.iteration_tasks:
diff --git a/masci_tools/io/parsers/fleur/fleur_schema/schema_dict.py b/masci_tools/io/parsers/fleur/fleur_schema/schema_dict.py
index ebe15603..59525534 100644
--- a/masci_tools/io/parsers/fleur/fleur_schema/schema_dict.py
+++ b/masci_tools/io/parsers/fleur/fleur_schema/schema_dict.py
@@ -322,17 +322,15 @@ class OutputSchemaDict(SchemaDict):
             parser_info_out['parser_warnings'].append(
                 f'Creating OutputSchemaDict object for differing versions (out: {version}; inp: {inp_version})')
 
-        version_hash = hash((version, inp_version))
-
-        if version_hash in cls.__schema_dict_cache and not no_cache:
-            return cls.__schema_dict_cache[version_hash]
+        if (version, inp_version) in cls.__schema_dict_cache and not no_cache:
+            return cls.__schema_dict_cache[(version, inp_version)]
 
         inpschema_dict = InputSchemaDict.fromVersion(inp_version, no_cache=no_cache)
-        cls.__schema_dict_cache[version_hash] = cls.fromPath(schema_file_path,
-                                                             inp_path=inpschema_file_path,
-                                                             inpschema_dict=inpschema_dict)
+        cls.__schema_dict_cache[(version, inp_version)] = cls.fromPath(schema_file_path,
+                                                                       inp_path=inpschema_file_path,
+                                                                       inpschema_dict=inpschema_dict)
 
-        return cls.__schema_dict_cache[version_hash]
+        return cls.__schema_dict_cache[(version, inp_version)]
 
     @classmethod
     def fromPath(cls, path, inp_path=None, inpschema_dict=None):
diff --git a/masci_tools/io/parsers/fleur/outxml_conversions.py b/masci_tools/io/parsers/fleur/outxml_conversions.py
index fb4e1a06..b19478ca 100644
--- a/masci_tools/io/parsers/fleur/outxml_conversions.py
+++ b/masci_tools/io/parsers/fleur/outxml_conversions.py
@@ -196,7 +196,7 @@ def convert_relax_info(out_dict, parser_info_out=None):
 
     out_dict['relax_atomtype_info'] = []
     for specie in species:
-        out_dict['relax_atomtype_info'].append([specie, species_info[specie]])
+        out_dict['relax_atomtype_info'].append((specie, species_info[specie]))
 
     return out_dict
 
@@ -210,27 +210,30 @@ def convert_forces(out_dict, parser_info_out=None):
     """
     parsed_forces = out_dict.pop('parsed_forces')
 
-    if 'force_largest' not in out_dict:
-        out_dict['force_largest'] = []
+    if 'force_largest_component' not in out_dict:
+        out_dict['force_largest_component'] = []
+        out_dict['force_atoms'] = []
+        out_dict['abspos_atoms'] = []
 
     if isinstance(parsed_forces['atom_type'], int):
         parsed_forces = {key: [val] for key, val in parsed_forces.items()}
 
     largest_force = 0.0
+    forces = []
+    abspos = []
     for index, atomType in enumerate(parsed_forces['atom_type']):
 
-        if f'force_x_type{atomType}' not in out_dict:
-            out_dict[f'force_x_type{atomType}'] = []
-            out_dict[f'force_y_type{atomType}'] = []
-            out_dict[f'force_z_type{atomType}'] = []
-            out_dict[f'abspos_x_type{atomType}'] = []
-            out_dict[f'abspos_y_type{atomType}'] = []
-            out_dict[f'abspos_z_type{atomType}'] = []
-
         force_x = parsed_forces['f_x'][index]
         force_y = parsed_forces['f_y'][index]
         force_z = parsed_forces['f_z'][index]
 
+        x = parsed_forces['x'][index]
+        y = parsed_forces['y'][index]
+        z = parsed_forces['z'][index]
+
+        forces.append((atomType, [force_x, force_y, force_z]))
+        abspos.append((atomType, [x, y, z]))
+
         if abs(force_x) > largest_force:
             largest_force = abs(force_x)
         if abs(force_y) > largest_force:
@@ -238,14 +241,8 @@ def convert_forces(out_dict, parser_info_out=None):
         if abs(force_z) > largest_force:
             largest_force = abs(force_z)
 
-        out_dict[f'force_x_type{atomType}'].append(force_x)
-        out_dict[f'force_y_type{atomType}'].append(force_y)
-        out_dict[f'force_z_type{atomType}'].append(force_z)
-
-        out_dict[f'abspos_x_type{atomType}'].append(parsed_forces['x'][index])
-        out_dict[f'abspos_y_type{atomType}'].append(parsed_forces['y'][index])
-        out_dict[f'abspos_z_type{atomType}'].append(parsed_forces['z'][index])
-
-    out_dict['force_largest'].append(largest_force)
+    out_dict['force_largest_component'].append(largest_force)
+    out_dict['force_atoms'].append(forces)
+    out_dict['abspos_atoms'].append(abspos)
 
     return out_dict


Test patch:
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_add_tasks_append.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_add_tasks_append.yml
index 478a6563..d0a8d372 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_add_tasks_append.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_add_tasks_append.yml
@@ -2,10 +2,9 @@ output_dict:
   bandgap: 2.2729704824
   bandgap_units: eV
   charge_den_xc_den_integral: -41.7653329254
-  charge_density: 0.026112816
   creator_name: fleur 32
   creator_target_architecture: GEN
-  creator_target_structure: null
+  density_convergence: 0.026112816
   density_convergence_units: me/bohr^3
   end_date:
     date: 2020/12/10
@@ -25,6 +24,7 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 6
   number_of_iterations_total: 6
+  number_of_kpoints: 2
   number_of_species: 1
   number_of_spin_components: 1
   number_of_symmetries: 48
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_add_tasks_overwrite.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_add_tasks_overwrite.yml
index ee9de470..ca2585be 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_add_tasks_overwrite.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_add_tasks_overwrite.yml
@@ -1,10 +1,9 @@
 output_dict:
   bandgap: -580.0645652222
   charge_den_xc_den_integral: -41.7653329254
-  charge_density: 0.026112816
   creator_name: fleur 32
   creator_target_architecture: GEN
-  creator_target_structure: null
+  density_convergence: 0.026112816
   density_convergence_units: me/bohr^3
   end_date:
     date: 2020/12/10
@@ -24,6 +23,7 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 6
   number_of_iterations_total: 6
+  number_of_kpoints: 2
   number_of_species: 1
   number_of_spin_components: 1
   number_of_symmetries: 48
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_additional_tasks_allattribs.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_additional_tasks_allattribs.yml
index 84fe27f6..94be15fd 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_additional_tasks_allattribs.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_additional_tasks_allattribs.yml
@@ -2,7 +2,6 @@ output_dict:
   bandgap: 2.2729704824
   bandgap_units: eV
   charge_den_xc_den_integral: -41.7653329254
-  charge_density: 0.026112816
   core_info:
     core_info_atom_type: 1
     core_info_atomic_number: 14
@@ -12,7 +11,7 @@ output_dict:
     core_info_spin: 1
   creator_name: fleur 32
   creator_target_architecture: GEN
-  creator_target_structure: null
+  density_convergence: 0.026112816
   density_convergence_units: me/bohr^3
   end_date:
     date: 2020/12/10
@@ -32,6 +31,7 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 6
   number_of_iterations_total: 6
+  number_of_kpoints: 2
   number_of_species: 1
   number_of_spin_components: 1
   number_of_symmetries: 48
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_additional_tasks_simple.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_additional_tasks_simple.yml
index 21a513f7..2f049804 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_additional_tasks_simple.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_additional_tasks_simple.yml
@@ -2,11 +2,10 @@ output_dict:
   bandgap: 2.2729704824
   bandgap_units: eV
   charge_den_xc_den_integral: -41.7653329254
-  charge_density: 0.026112816
   core_eig_val_sum: -130.3854013875
   creator_name: fleur 32
   creator_target_architecture: GEN
-  creator_target_structure: null
+  density_convergence: 0.026112816
   density_convergence_units: me/bohr^3
   end_date:
     date: 2020/12/10
@@ -26,6 +25,7 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 6
   number_of_iterations_total: 6
+  number_of_kpoints: 2
   number_of_species: 1
   number_of_spin_components: 1
   number_of_symmetries: 48
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_alliter.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_alliter.yml
index 1bdf9046..1be6d25c 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_alliter.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_alliter.yml
@@ -14,16 +14,15 @@ output_dict:
   - -41.7699610697
   - -41.7648027154
   - -41.7653329254
-  charge_density:
+  creator_name: fleur 32
+  creator_target_architecture: GEN
+  density_convergence:
   - 8.7379598265
   - 8.2515493263
   - 1.0238480245
   - 0.5765372317
   - 0.2277277793
   - 0.026112816
-  creator_name: fleur 32
-  creator_target_architecture: GEN
-  creator_target_structure: null
   density_convergence_units: me/bohr^3
   end_date:
     date: 2020/12/10
@@ -73,6 +72,7 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 6
   number_of_iterations_total: 6
+  number_of_kpoints: 2
   number_of_species: 1
   number_of_spin_components: 1
   number_of_symmetries: 48
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_broken.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_broken.yml
index 256d955e..ba0b0afa 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_broken.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_broken.yml
@@ -2,12 +2,11 @@ output_dict:
   bandgap: 0.0323610284
   bandgap_units: eV
   charge_den_xc_den_integral: -111.9182938603
-  charge_density:
-  - 9.2786635283
-  - 5.4278279348
   creator_name: fleur 32
   creator_target_architecture: GEN
-  creator_target_structure: null
+  density_convergence:
+  - 9.2786635283
+  - 5.4278279348
   density_convergence_units: me/bohr^3
   end_date:
     date: null
@@ -36,12 +35,13 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 4
   number_of_iterations_total: 2
+  number_of_kpoints: 3
   number_of_species: 1
   number_of_spin_components: 2
   number_of_symmetries: 16
   output_file_version: '0.34'
-  overall_charge_density: 10.8914872112
-  spin_density: 10.6059102509
+  overall_density_convergence: 10.8914872112
+  spin_density_convergence: 10.6059102509
   spin_dependent_charge_interstitial:
   - 1.00491
   - 1.0077593
@@ -63,6 +63,7 @@ output_dict:
 warnings:
   fleur_modes:
     band: false
+    bz_integration: hist
     dos: false
     film: false
     jspin: 2
@@ -71,10 +72,9 @@ warnings:
     relax: false
     soc: false
   last_iteration_parsed: 2
-  parser_info: Masci-Tools Fleur out.xml Parser v0.3.0
+  parser_info: Masci-Tools Fleur out.xml Parser v0.4.0
   parser_warnings:
   - The out.xml file is broken I try to repair it.
-  - No text found for tag targetStructureClass
   - No values found for attribute date at tag endDateAndTime
   - No values found for attribute time at tag endDateAndTime
   - Endtime was unparsed, inp.xml prob not complete, do not believe the walltime!
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_broken_firstiter.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_broken_firstiter.yml
index a40828c7..d41d1156 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_broken_firstiter.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_broken_firstiter.yml
@@ -2,10 +2,9 @@ output_dict:
   bandgap: null
   bandgap_units: null
   charge_den_xc_den_integral: null
-  charge_density: null
   creator_name: fleur 32
   creator_target_architecture: GEN
-  creator_target_structure: null
+  density_convergence: null
   density_convergence_units: null
   end_date:
     date: null
@@ -28,12 +27,13 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 1
   number_of_iterations_total: 1
+  number_of_kpoints: 3
   number_of_species: 1
   number_of_spin_components: 2
   number_of_symmetries: 16
   output_file_version: '0.34'
-  overall_charge_density: null
-  spin_density: null
+  overall_density_convergence: null
+  spin_density_convergence: null
   spin_dependent_charge_interstitial: null
   spin_dependent_charge_mt_spheres: null
   spin_dependent_charge_total: null
@@ -48,6 +48,7 @@ output_dict:
 warnings:
   fleur_modes:
     band: false
+    bz_integration: hist
     dos: false
     film: false
     jspin: 2
@@ -56,10 +57,9 @@ warnings:
     relax: false
     soc: false
   last_iteration_parsed: 1
-  parser_info: Masci-Tools Fleur out.xml Parser v0.3.0
+  parser_info: Masci-Tools Fleur out.xml Parser v0.4.0
   parser_warnings:
   - The out.xml file is broken I try to repair it.
-  - No text found for tag targetStructureClass
   - No values found for attribute date at tag endDateAndTime
   - No values found for attribute time at tag endDateAndTime
   - Endtime was unparsed, inp.xml prob not complete, do not believe the walltime!
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_differing_versions.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_differing_versions.yml
index f53ec6e6..277d18f9 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_differing_versions.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_differing_versions.yml
@@ -2,12 +2,11 @@ output_dict:
   bandgap: 0.1480235793
   bandgap_units: eV
   charge_den_xc_den_integral: -111.7983059673
-  charge_density:
-  - 0.0056284998
-  - 0.0037099809
   creator_name: fleur 32
   creator_target_architecture: GEN
-  creator_target_structure: null
+  density_convergence:
+  - 0.0056284998
+  - 0.0037099809
   density_convergence_units: me/bohr^3
   end_date:
     date: 2021/01/22
@@ -36,6 +35,7 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 20
   number_of_iterations_total: 20
+  number_of_kpoints: 3
   number_of_species: 2
   number_of_spin_components: 2
   number_of_symmetries: 16
@@ -49,8 +49,8 @@ output_dict:
   - -0.0297277809
   - -0.0297267268
   output_file_version: '0.34'
-  overall_charge_density: 0.0060794373
-  spin_density: 0.0073435944
+  overall_density_convergence: 0.0060794373
+  spin_density_convergence: 0.0073435944
   spin_dependent_charge_interstitial:
   - 0.9585356
   - 0.9585064
@@ -72,6 +72,7 @@ output_dict:
 warnings:
   fleur_modes:
     band: false
+    bz_integration: hist
     dos: false
     film: false
     jspin: 2
@@ -79,7 +80,6 @@ warnings:
     noco: true
     relax: false
     soc: true
-  parser_info: Masci-Tools Fleur out.xml Parser v0.3.0
+  parser_info: Masci-Tools Fleur out.xml Parser v0.4.0
   parser_warnings:
   - 'Creating OutputSchemaDict object for differing versions (out: 0.34; inp: 0.33)'
-  - No text found for tag targetStructureClass
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_empty_out.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_empty_out.yml
index 9b5f432a..743e0f0b 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_empty_out.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_empty_out.yml
@@ -1,6 +1,6 @@
 output_dict: {}
 warnings:
-  parser_info: Masci-Tools Fleur out.xml Parser v0.3.0
+  parser_info: Masci-Tools Fleur out.xml Parser v0.4.0
   parser_warnings:
   - The out.xml file is broken I try to repair it.
   - Skipping the parsing of the xml file. Repairing was not possible.
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_firstiter.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_firstiter.yml
index cd78d9cc..8b60fe0a 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_firstiter.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_firstiter.yml
@@ -2,10 +2,9 @@ output_dict:
   bandgap: 2.5515073686
   bandgap_units: eV
   charge_den_xc_den_integral: -41.7144813139
-  charge_density: 8.7379598265
   creator_name: fleur 32
   creator_target_architecture: GEN
-  creator_target_structure: null
+  density_convergence: 8.7379598265
   density_convergence_units: me/bohr^3
   end_date:
     date: 2020/12/10
@@ -25,6 +24,7 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 6
   number_of_iterations_total: 1
+  number_of_kpoints: 2
   number_of_species: 1
   number_of_spin_components: 1
   number_of_symmetries: 48
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_force.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_force.yml
index ee1023b2..6d8466ee 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_force.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_force.yml
@@ -1,7 +1,6 @@
 output_dict:
   creator_name: fleur 32
   creator_target_architecture: GEN
-  creator_target_structure: null
   end_date:
     date: 2020/12/10
     time: '16:58:39'
@@ -11,6 +10,7 @@ output_dict:
   number_of_atom_types: 2
   number_of_atoms: 2
   number_of_iterations: 1
+  number_of_kpoints: 2
   number_of_species: 2
   number_of_spin_components: 2
   number_of_symmetries: 2
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_garbage_values.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_garbage_values.yml
index d56a9716..3c62d9fb 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_garbage_values.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_garbage_values.yml
@@ -1,6 +1,7 @@
 warnings:
   fleur_modes:
     band: false
+    bz_integration: tetra
     dos: false
     film: false
     jspin: 2
@@ -8,14 +9,11 @@ warnings:
     noco: false
     relax: false
     soc: false
-  parser_info: Masci-Tools Fleur out.xml Parser v0.3.0
+  parser_info: Masci-Tools Fleur out.xml Parser v0.4.0
   parser_warnings:
   - "Output file does not validate against the schema: \nLine 591: Element 'FermiEnergy',\
     \ attribute 'value': 'NAN' is not a valid value of the atomic type 'xs:double'.\
     \ \nLine 624: Element 'magneticMoment', attribute 'moment': '********' is not\
     \ a valid value of the atomic type 'xs:double'. \n"
-  - No text found for tag targetStructureClass
-  - No values found for attribute units at tag bandgap
-  - No values found for attribute value at tag bandgap
   - 'Failed to evaluate attribute moment: Below are the warnings from convert_xml_attribute'
   - 'Could not convert: ''********'' to float, ValueError'
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_indexiter.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_indexiter.yml
index 0761add4..544aaf57 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_indexiter.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_indexiter.yml
@@ -2,10 +2,9 @@ output_dict:
   bandgap: 2.2557459059
   bandgap_units: eV
   charge_den_xc_den_integral: -41.7699610697
-  charge_density: 0.5765372317
   creator_name: fleur 32
   creator_target_architecture: GEN
-  creator_target_structure: null
+  density_convergence: 0.5765372317
   density_convergence_units: me/bohr^3
   end_date:
     date: 2020/12/10
@@ -25,6 +24,7 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 6
   number_of_iterations_total: 4
+  number_of_kpoints: 2
   number_of_species: 1
   number_of_spin_components: 1
   number_of_symmetries: 48
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_lastiter.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_lastiter.yml
index 7b252b6a..32fc5689 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_lastiter.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_lastiter.yml
@@ -2,10 +2,9 @@ output_dict:
   bandgap: 2.2729704824
   bandgap_units: eV
   charge_den_xc_den_integral: -41.7653329254
-  charge_density: 0.026112816
   creator_name: fleur 32
   creator_target_architecture: GEN
-  creator_target_structure: null
+  density_convergence: 0.026112816
   density_convergence_units: me/bohr^3
   end_date:
     date: 2020/12/10
@@ -25,6 +24,7 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 6
   number_of_iterations_total: 6
+  number_of_kpoints: 2
   number_of_species: 1
   number_of_spin_components: 1
   number_of_symmetries: 48
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_ldaurelax.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_ldaurelax.yml
index af024f84..488a1d89 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_ldaurelax.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_ldaurelax.yml
@@ -1,22 +1,21 @@
 output_dict:
-  abspos_x_type1:
-  - -1.3806
-  - -1.3806
-  abspos_x_type2:
-  - 1.3806
-  - 1.3806
-  abspos_y_type1:
-  - -1.3806
-  - -1.3806
-  abspos_y_type2:
-  - 1.3806
-  - 1.3806
-  abspos_z_type1:
-  - -1.3806
-  - -1.3806
-  abspos_z_type2:
-  - 1.3806
-  - 1.3806
+  abspos_atoms:
+  - - - 1
+      - - -1.3806
+        - -1.3806
+        - -1.3806
+    - - 2
+      - - 1.3806
+        - 1.3806
+        - 1.3806
+  - - - 1
+      - - -1.3806
+        - -1.3806
+        - -1.3806
+    - - 2
+      - - 1.3806
+        - 1.3806
+        - 1.3806
   bandgap:
   - 4.1667073913
   - 4.1667065775
@@ -24,12 +23,11 @@ output_dict:
   charge_den_xc_den_integral:
   - -159.6317907519
   - -159.6317901441
-  charge_density:
-  - 0.0003427664
-  - null
   creator_name: fleur 32
   creator_target_architecture: GEN
-  creator_target_structure: null
+  density_convergence:
+  - 0.0003427664
+  - null
   density_convergence_units: me/bohr^3
   end_date:
     date: 2020/12/10
@@ -53,28 +51,27 @@ output_dict:
   - 0.1259314083
   fermi_energy_units: Htr
   film: false
-  force_largest:
+  force_atoms:
+  - - - 1
+      - - 0.01798072
+        - 0.01798072
+        - 0.01798072
+    - - 2
+      - - -0.01797115
+        - -0.01797115
+        - -0.01797115
+  - - - 1
+      - - 0.01798072
+        - 0.01798072
+        - 0.01798072
+    - - 2
+      - - -0.01797158
+        - -0.01797158
+        - -0.01797158
+  force_largest_component:
   - 0.01798072
   - 0.01798072
   force_units: Htr/bohr
-  force_x_type1:
-  - 0.01798072
-  - 0.01798072
-  force_x_type2:
-  - -0.01797115
-  - -0.01797158
-  force_y_type1:
-  - 0.01798072
-  - 0.01798072
-  force_y_type2:
-  - -0.01797115
-  - -0.01797158
-  force_z_type1:
-  - 0.01798072
-  - 0.01798072
-  force_z_type2:
-  - -0.01797115
-  - -0.01797158
   gmax: 10.8
   kmax: 3.6
   ldau_info:
@@ -110,6 +107,7 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 2
   number_of_iterations_total: 15
+  number_of_kpoints: 1
   number_of_species: 2
   number_of_spin_components: 1
   number_of_symmetries: 6
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_magnetic.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_magnetic.yml
index 485b2c84..a5805319 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_magnetic.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_magnetic.yml
@@ -10,7 +10,9 @@ output_dict:
   - -111.9182938603
   - -111.8007620588
   - -111.8088374177
-  charge_density:
+  creator_name: fleur 32
+  creator_target_architecture: GEN
+  density_convergence:
   - - 10.9851472966
     - 6.0389329792
   - - 9.2786635283
@@ -19,9 +21,6 @@ output_dict:
     - 4.3593512086
   - - 2.4271463257
     - 2.7205971142
-  creator_name: fleur 32
-  creator_target_architecture: GEN
-  creator_target_structure: null
   density_convergence_units: me/bohr^3
   end_date:
     date: 2020/12/10
@@ -88,16 +87,17 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 4
   number_of_iterations_total: 4
+  number_of_kpoints: 3
   number_of_species: 1
   number_of_spin_components: 2
   number_of_symmetries: 16
   output_file_version: '0.34'
-  overall_charge_density:
+  overall_density_convergence:
   - 13.455846664
   - 10.8914872112
   - 3.3253791756
   - 1.5936155801
-  spin_density:
+  spin_density_convergence:
   - 11.5422933539
   - 10.6059102509
   - 6.4298583438
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_max3_1compatibility.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_max3_1compatibility.yml
index 3b75aa73..91ba3dbc 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_max3_1compatibility.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_max3_1compatibility.yml
@@ -42,7 +42,9 @@ output_dict:
   - -111.7975545789
   - -111.7975806104
   - -111.7975941179
-  charge_density:
+  creator_name: fleur 30
+  creator_target_architecture: GEN
+  density_convergence:
   - - 11.684486802
     - 6.3875950921
   - - 9.4214389223
@@ -83,9 +85,6 @@ output_dict:
     - 0.0116592241
   - - 0.0105072076
     - 0.0140933041
-  creator_name: fleur 30
-  creator_target_architecture: GEN
-  creator_target_structure: null
   density_convergence_units: me/bohr^3
   end_date:
     date: 2021/01/28
@@ -328,6 +327,7 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 20
   number_of_iterations_total: 20
+  number_of_kpoints: 3
   number_of_species: 1
   number_of_spin_components: 2
   number_of_symmetries: 0
@@ -455,7 +455,7 @@ output_dict:
   - - -0.0313809925
     - -0.0314064963
   output_file_version: '0.27'
-  overall_charge_density:
+  overall_density_convergence:
   - 14.8354961984
   - 11.3962275632
   - 3.0483883255
@@ -476,7 +476,7 @@ output_dict:
   - 0.0138998442
   - 0.0148527535
   - 0.0191738425
-  spin_density:
+  spin_density_convergence:
   - 11.6002266495
   - 10.4813152765
   - 7.0781929774
@@ -692,6 +692,7 @@ output_dict:
 warnings:
   fleur_modes:
     band: false
+    bz_integration: hist
     dos: false
     film: false
     jspin: 2
@@ -699,7 +700,7 @@ warnings:
     noco: true
     relax: false
     soc: true
-  parser_info: Masci-Tools Fleur out.xml Parser v0.3.0
+  parser_info: Masci-Tools Fleur out.xml Parser v0.4.0
   parser_warnings:
   - Ignoring '0.27' outputVersion for MaX3.1 release
   - "Output file does not validate against the schema: \nLine 16: Element 'inputData':\
@@ -709,4 +710,3 @@ warnings:
     \ \nLine 85: Element 'kPointList', attribute 'posScale': The attribute 'posScale'\
     \ is not allowed. \nLine 91: Element 'spinDependentCharge': This element is not\
     \ expected. \n"
-  - No text found for tag targetStructureClass
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_max4compatibility.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_max4compatibility.yml
index 2e4ce786..c551e093 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_max4compatibility.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_max4compatibility.yml
@@ -26,7 +26,9 @@ output_dict:
   - -159.6221456328
   - -159.6223715446
   - -159.6223536715
-  charge_density:
+  creator_name: fleur 31
+  creator_target_architecture: GEN
+  density_convergence:
   - 6.6846995052
   - 6.1435434886
   - 3.8085569559
@@ -39,9 +41,6 @@ output_dict:
   - 0.0074941641
   - 0.0017151783
   - 0.0003274009
-  creator_name: fleur 31
-  creator_target_architecture: GEN
-  creator_target_structure: null
   density_convergence_units: me/bohr^3
   end_date:
     date: 2020/10/06
@@ -157,6 +156,7 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 12
   number_of_iterations_total: 12
+  number_of_kpoints: 6
   number_of_species: 2
   number_of_spin_components: 1
   number_of_symmetries: 0
@@ -235,6 +235,7 @@ output_dict:
 warnings:
   fleur_modes:
     band: false
+    bz_integration: hist
     dos: false
     film: false
     jspin: 1
@@ -242,7 +243,7 @@ warnings:
     noco: false
     relax: false
     soc: false
-  parser_info: Masci-Tools Fleur out.xml Parser v0.3.0
+  parser_info: Masci-Tools Fleur out.xml Parser v0.4.0
   parser_warnings:
   - Ignoring '0.27' outputVersion for MaX4.0 release
   - "Output file does not validate against the schema: \nLine 17: Element 'inputData':\
@@ -250,4 +251,3 @@ warnings:
     \ 'atomsInCell': The attribute 'n_hia' is required but missing. \nLine 100: Element\
     \ 'kPointList', attribute 'posScale': The attribute 'posScale' is not allowed.\
     \ \nLine 109: Element 'spinDependentCharge': This element is not expected. \n"
-  - No text found for tag targetStructureClass
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_max5_0_compatibility.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_max5_0_compatibility.yml
index 55505db0..cfa25432 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_max5_0_compatibility.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_max5_0_compatibility.yml
@@ -26,7 +26,9 @@ output_dict:
   - -159.6315020089
   - -159.6317756613
   - -159.6317889102
-  charge_density:
+  creator_name: fleur 32
+  creator_target_architecture: GEN
+  density_convergence:
   - 7.6594195508
   - 7.073203372
   - 4.0712886772
@@ -39,9 +41,6 @@ output_dict:
   - 0.0111727979
   - 0.0021412
   - 0.0003416974
-  creator_name: fleur 32
-  creator_target_architecture: GEN
-  creator_target_structure: null
   density_convergence_units: me/bohr^3
   end_date:
     date: 2021/01/19
@@ -170,6 +169,7 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 12
   number_of_iterations_total: 12
+  number_of_kpoints: 1
   number_of_species: 2
   number_of_spin_components: 1
   number_of_symmetries: 6
@@ -248,6 +248,7 @@ output_dict:
 warnings:
   fleur_modes:
     band: false
+    bz_integration: hist
     dos: false
     film: false
     jspin: 1
@@ -255,7 +256,7 @@ warnings:
     noco: false
     relax: false
     soc: false
-  parser_info: Masci-Tools Fleur out.xml Parser v0.3.0
+  parser_info: Masci-Tools Fleur out.xml Parser v0.4.0
   parser_warnings:
   - Ignoring '0.27' outputVersion for MaX5.0 release
   - "Output file does not validate against the schema: \nLine 131: Element 'kPointList',\
@@ -263,4 +264,3 @@ warnings:
     \ 'kPointList': The attribute 'weightScale' is required but missing. \nLine 135:\
     \ Element 'spinDependentCharge': This element is not expected. \n"
   - No values found for attribute l_f
-  - No text found for tag targetStructureClass
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_minimal_mode.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_minimal_mode.yml
index 475cd8c0..adb062ea 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_minimal_mode.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_minimal_mode.yml
@@ -1,14 +1,13 @@
 output_dict:
-  charge_density:
+  creator_name: fleur 32
+  creator_target_architecture: GEN
+  density_convergence:
   - 8.7379598265
   - 8.2515493263
   - 1.0238480245
   - 0.5765372317
   - 0.2277277793
   - 0.026112816
-  creator_name: fleur 32
-  creator_target_architecture: GEN
-  creator_target_structure: null
   density_convergence_units: me/bohr^3
   end_date:
     date: 2020/12/10
@@ -36,6 +35,7 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 6
   number_of_iterations_total: 6
+  number_of_kpoints: 2
   number_of_species: 1
   number_of_spin_components: 1
   number_of_symmetries: 48
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_newer_version.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_newer_version.yml
index a32ed3d4..4bd00fd0 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_newer_version.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_newer_version.yml
@@ -2,12 +2,11 @@ output_dict:
   bandgap: 0.0572228408
   bandgap_units: eV
   charge_den_xc_den_integral: -111.8088374177
-  charge_density:
-  - 2.4271463257
-  - 2.7205971142
   creator_name: fleur 32
   creator_target_architecture: GEN
-  creator_target_structure: null
+  density_convergence:
+  - 2.4271463257
+  - 2.7205971142
   density_convergence_units: me/bohr^3
   end_date:
     date: 2020/12/10
@@ -36,12 +35,13 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 4
   number_of_iterations_total: 4
+  number_of_kpoints: 3
   number_of_species: 1
   number_of_spin_components: 2
   number_of_symmetries: 16
   output_file_version: '0.36'
-  overall_charge_density: 1.5936155801
-  spin_density: 4.9036481595
+  overall_density_convergence: 1.5936155801
+  spin_density_convergence: 4.9036481595
   spin_dependent_charge_interstitial:
   - 0.953185
   - 0.9525573
@@ -63,6 +63,7 @@ output_dict:
 warnings:
   fleur_modes:
     band: false
+    bz_integration: hist
     dos: false
     film: false
     jspin: 2
@@ -70,7 +71,7 @@ warnings:
     noco: true
     relax: false
     soc: false
-  parser_info: Masci-Tools Fleur out.xml Parser v0.3.0
+  parser_info: Masci-Tools Fleur out.xml Parser v0.4.0
   parser_warnings:
   - No Output Schema available for version '0.36'; falling back to '0.34'
   - No Input Schema available for version '0.36'; falling back to '0.34'
@@ -79,4 +80,3 @@ warnings:
     \ an element of the set {'0.34'}. \nLine 16: Element 'fleurInput', attribute 'fleurInputVersion':\
     \ [facet 'enumeration'] The value '0.36' is not an element of the set {'0.34'}.\
     \ \n"
-  - No text found for tag targetStructureClass
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_pre_max3_1compatibility.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_pre_max3_1compatibility.yml
index 95a3e086..1647a9ca 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_pre_max3_1compatibility.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_pre_max3_1compatibility.yml
@@ -10,7 +10,9 @@ output_dict:
   - -111.9237671976
   - -111.8007892626
   - -111.8137206932
-  charge_density:
+  creator_name: fleur 27
+  creator_target_architecture: GEN
+  density_convergence:
   - - 11.3070796811
     - 6.349138471
   - - 9.5004625695
@@ -19,9 +21,6 @@ output_dict:
     - 4.2692445478
   - - 2.564353547
     - 2.092207419
-  creator_name: fleur 27
-  creator_target_architecture: GEN
-  creator_target_structure: null
   density_convergence_units: me/bohr^3
   end_date:
     date: 2021/01/28
@@ -88,16 +87,17 @@ output_dict:
   number_of_atoms: 2
   number_of_iterations: 4
   number_of_iterations_total: 4
+  number_of_kpoints: null
   number_of_species: 1
   number_of_spin_components: 2
   number_of_symmetries: 0
   output_file_version: '0.27'
-  overall_charge_density:
+  overall_density_convergence:
   - 14.2933028381
   - 11.5538575761
   - 3.3076624962
   - 1.4762736535
-  spin_density:
+  spin_density_convergence:
   - 11.4902008012
   - 10.5246537798
   - 6.3421007934
@@ -136,6 +136,7 @@ output_dict:
 warnings:
   fleur_modes:
     band: false
+    bz_integration: hist
     dos: false
     film: false
     jspin: 2
@@ -143,7 +144,7 @@ warnings:
     noco: true
     relax: false
     soc: false
-  parser_info: Masci-Tools Fleur out.xml Parser v0.3.0
+  parser_info: Masci-Tools Fleur out.xml Parser v0.4.0
   parser_warnings:
   - Found version before MaX3.1 release falling back to file version '0.29'
   - "Output file does not validate against the schema: \nLine 14: Element 'inputData':\
@@ -153,7 +154,7 @@ warnings:
     \ is not allowed. \nLine 72: Element 'numericalParameters': Missing child element(s).\
     \ Expected is ( volumes ). \nLine 73: Element 'atomsInCell': The attribute 'n_hia'\
     \ is required but missing. \n"
-  - No text found for tag targetStructureClass
+  - No values found for attribute count
   - No values found for attribute interstitial at tag spinDependentCharge
   - No values found for attribute mtSpheres at tag spinDependentCharge
   - No values found for attribute total at tag spinDependentCharge
diff --git a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_validation_errors.yml b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_validation_errors.yml
index 0f9668aa..f40224fa 100644
--- a/masci_tools/tests/test_fleur_outxml_parser/test_outxml_validation_errors.yml
+++ b/masci_tools/tests/test_fleur_outxml_parser/test_outxml_validation_errors.yml
@@ -1,13 +1,10 @@
 output_dict:
-  bandgap: null
-  bandgap_units: null
   charge_den_xc_den_integral: -55.9720588982
-  charge_density:
-  - 6.4966088913
-  - 11.8289058385
   creator_name: fleur 32
   creator_target_architecture: GEN
-  creator_target_structure: null
+  density_convergence:
+  - 6.4966088913
+  - 11.8289058385
   density_convergence_units: me/bohr^3
   end_date:
     date: 2020/12/10
@@ -30,12 +27,13 @@ output_dict:
   number_of_atoms: 1
   number_of_iterations: 1
   number_of_iterations_total: 1
+  number_of_kpoints: 10
   number_of_species: 1
   number_of_spin_components: 2
   number_of_symmetries: 48
   output_file_version: '0.34'
-  overall_charge_density: 16.4186207974
-  spin_density: 9.7307128187
+  overall_density_convergence: 16.4186207974
+  spin_density_convergence: 9.7307128187
   spin_dependent_charge_interstitial:
   - 0.6160276
   - 0.6242332
@@ -57,6 +55,7 @@ output_dict:
 warnings:
   fleur_modes:
     band: false
+    bz_integration: tetra
     dos: false
     film: false
     jspin: 2
@@ -64,11 +63,8 @@ warnings:
     noco: false
     relax: false
     soc: false
-  parser_info: Masci-Tools Fleur out.xml Parser v0.3.0
+  parser_info: Masci-Tools Fleur out.xml Parser v0.4.0
   parser_warnings:
   - "Output file does not validate against the schema: \nLine 346: Element 'kPointList',\
     \ attribute 'weightSc': The attribute 'weightSc' is not allowed. \nLine 346: Element\
     \ 'kPointList': The attribute 'weightScale' is required but missing. \n"
-  - No text found for tag targetStructureClass
-  - No values found for attribute units at tag bandgap
-  - No values found for attribute value at tag bandgap