calculate_band_gap_from_occupations (parsers/utils/general.py) classifies states as occupied/unoccupied at a universal threshold (0.5) and reports the CBM-VBM distance. Review raised whether band gaps are always safely derivable this way: smeared or fractional occupations (metals, finite-temperature smearing) can straddle the threshold and yield a spurious finite gap, and the threshold itself differs in meaning between spin-polarized (0-1) and non-polarized (0-2) conventions.
The unit test test_partial_occupation_threshold_gap documents the current behavior for partial occupations rather than endorsing it.
Done when: the derivation is reviewed (e.g. gap only reported when occupations are near-integer, or smearing-aware criteria), and parsers relying on the utility are adjusted accordingly.
calculate_band_gap_from_occupations(parsers/utils/general.py) classifies states as occupied/unoccupied at a universal threshold (0.5) and reports the CBM-VBM distance. Review raised whether band gaps are always safely derivable this way: smeared or fractional occupations (metals, finite-temperature smearing) can straddle the threshold and yield a spurious finite gap, and the threshold itself differs in meaning between spin-polarized (0-1) and non-polarized (0-2) conventions.The unit test
test_partial_occupation_threshold_gapdocuments the current behavior for partial occupations rather than endorsing it.Done when: the derivation is reviewed (e.g. gap only reported when occupations are near-integer, or smearing-aware criteria), and parsers relying on the utility are adjusted accordingly.