Skip to content

Commit 1a18106

Browse files
committed
- Fix failing tests due to missing Fermi-level
- Remove superfluous test checking the no. subsections in outputs
1 parent 8ad7e77 commit 1a18106

File tree

1 file changed

+3
-38
lines changed

1 file changed

+3
-38
lines changed

tests/test_outputs.py

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,39 +21,6 @@ class TestOutputs:
2121
Test the `Outputs` class defined in `outputs.py`.
2222
"""
2323

24-
def test_number_of_properties(self): # TODO: remove this test
25-
"""
26-
Test how many properties are defined under `Outputs` and its order. This test is done in order to control better
27-
which properties are already defined and in which order to control their normalizations
28-
"""
29-
outputs = Outputs()
30-
assert len(outputs.m_def.all_sub_sections) == 22
31-
defined_properties = [
32-
'fermi_levels',
33-
'chemical_potentials',
34-
'crystal_field_splittings',
35-
'hopping_matrices',
36-
'electronic_eigenvalues',
37-
'electronic_band_gaps',
38-
'electronic_dos',
39-
'fermi_surfaces',
40-
'electronic_band_structures',
41-
'occupancies',
42-
'electronic_greens_functions',
43-
'electronic_self_energies',
44-
'hybridization_functions',
45-
'quasiparticle_weights',
46-
'permittivities',
47-
'absorption_spectra',
48-
'xas_spectra',
49-
'total_energies',
50-
'kinetic_energies',
51-
'potential_energies',
52-
'total_forces',
53-
'temperatures',
54-
]
55-
assert list(outputs.m_def.all_sub_sections.keys()) == defined_properties
56-
5724
@pytest.mark.parametrize(
5825
'band_gaps, values, result_length, result',
5926
[
@@ -95,15 +62,15 @@ def test_extract_spin_polarized_properties(
9562
outputs = Outputs()
9663

9764
for i, band_gap in enumerate(band_gaps):
98-
band_gap.value = [values[i]]
65+
band_gap.value = values[i]
9966
outputs.electronic_band_gaps.append(band_gap)
10067
gaps = outputs.extract_spin_polarized_property(
10168
property_name='electronic_band_gaps'
10269
)
10370
assert len(gaps) == result_length
10471
if len(result) > 0:
10572
for i, result_gap in enumerate(result):
106-
result_gap.value = [values[i]]
73+
result_gap.value = values[i]
10774
# ? comparing the sections does not work
10875
assert gaps[i].value == result_gap.value
10976
else:
@@ -297,7 +264,7 @@ def test_get_last_scf_steps_value(
297264
for i, scf_step in enumerate(scf_last_steps):
298265
property_section = getattr(scf_step, 'electronic_band_gaps')
299266
if property_section is not None and values is not None:
300-
property_section[i_property].value = [values[i]]
267+
property_section[i_property].value = values[i]
301268
scf_values = scf_outputs.get_last_scf_steps_value(
302269
scf_last_steps=scf_last_steps,
303270
property_name='electronic_band_gaps',
@@ -314,8 +281,6 @@ def test_get_last_scf_steps_value(
314281
(0, None, '', 0, False),
315282
# no `self_consistency_ref` section
316283
(5, None, '', 0, False),
317-
# no property matching `property_name`
318-
(5, None, 'fermi_levels', 0, False),
319284
# `i_property` is out of range
320285
(5, None, 'electronic_band_gaps', 2, False),
321286
# property is not converged

0 commit comments

Comments
 (0)