The value of efermi saved in the tasks will still be the wrong value, because that value was precomputed. If you call a method like get_gap, that will recompute the VBM and CBM and allow you to get a correct estimate of the gap
We would need to reparse the data to correct the value of efermi that’s saved. A “hacky” way of looking at the correct band properties would be this:
from mp_api.client import MPRester
from pymatgen.electronic_structure.bandstructure import BandStructure
with MPRester() as mpr:
band_struc_orig = mpr.materials.electronic_structure_bandstructure.get_bandstructure_from_task_id("mp-1776854")
dos_orig = mpr.materials.electronic_structure_dos.get_dos_from_task_id("mp-1776854")
cbm, vbm = dos_orig.get_cbm_vbm()
band_struc_new = BandStructure(
[kpt.frac_coords for kpt in band_struc_orig.kpoints],
band_struc_orig.bands,
band_struc_orig.lattice_rec,
vbm,
band_struc_orig.labels_dict,
structure = band_struc_orig.structure
)
Running band_struc_new.get_gap() yields a 6.14 eV direct gap.
Unfortunately, right now, there’s no way to access the vasprun.xml or DOSCAR from which this data was extracted. We’re currently working on a solution for this (plus all other VASP outputs) but can’t give an estimate when that will be final