def _get_conduction_correction_indexes(correction_code, band_projection): """ Get the correction indexes needed to the corrrection """ if "cf" in correction_code: return get_fractionary_correction_indexes(band_projection) else: return get_simple_correction_indexes(band_projection)
def test_gec_2d_cbm(file_path): """ Test with GeC-2d """ procar_filename = file_path("/gec-2d/PROCAR") eigenval_filename = file_path("/gec-2d/EIGENVAL") vasprun_filename = file_path("/gec-2d/vasprun.xml") procar = Procar(procar_filename) vasprun = Vasprun(vasprun_filename) eigenval = Eigenvalues(eigenval_filename) band_structure = BandStructure(eigenvalues=eigenval.eigenvalues, fermi_energy=vasprun.fermi_energy, atoms_map=vasprun.atoms_map, num_bands=procar.num_bands, band_projection=procar) cbm_projection = band_structure.cbm_projection() cbm_df = projection_to_df(cbm_projection) correction_indexes = get_fractionary_correction_indexes(cbm_df) assert correction_indexes["Ge"][0] == "p"
def test_bn_2d_vbm_without_treshold(file_path): """ Test with BN-2d without treshold """ procar_filename = file_path("/bn-2d/PROCAR") eigenval_filename = file_path("/bn-2d/EIGENVAL") vasprun_filename = file_path("/bn-2d/vasprun.xml") procar = Procar(procar_filename) vasprun = Vasprun(vasprun_filename) eigenval = Eigenvalues(eigenval_filename) band_structure = BandStructure(eigenvalues=eigenval.eigenvalues, fermi_energy=vasprun.fermi_energy, atoms_map=vasprun.atoms_map, num_bands=procar.num_bands, band_projection=procar) vbm_projection = band_structure.vbm_projection() vbm_df = projection_to_df(vbm_projection) correction_indexes = get_fractionary_correction_indexes(vbm_df, treshold=0) assert correction_indexes["N"][0] == "p" assert correction_indexes["B"][0] == "p"
def test_aln_2d_cbm_treshold_30(file_path): """ Test with AlN-2d with treshold 29 """ procar_filename = file_path("/aln-2d/PROCAR") eigenval_filename = file_path("/aln-2d/EIGENVAL") vasprun_filename = file_path("/aln-2d/vasprun.xml") procar = Procar(procar_filename) vasprun = Vasprun(vasprun_filename) eigenval = Eigenvalues(eigenval_filename) band_structure = BandStructure(eigenvalues=eigenval.eigenvalues, fermi_energy=vasprun.fermi_energy, atoms_map=vasprun.atoms_map, num_bands=procar.num_bands, band_projection=procar) cbm_projection = band_structure.cbm_projection() cbm_df = projection_to_df(cbm_projection) correction_indexes = get_fractionary_correction_indexes(cbm_df, treshold=29) assert correction_indexes["N"][0] == "s" assert len(correction_indexes["Al"]) == 0
def test_gec_2d_vbm_changing_treshold_13(file_path): """ Test with GeC-2d with treshold_13 """ procar_filename = file_path("/gec-2d/PROCAR") eigenval_filename = file_path("/gec-2d/EIGENVAL") vasprun_filename = file_path("/gec-2d/vasprun.xml") procar = Procar(procar_filename) vasprun = Vasprun(vasprun_filename) eigenval = Eigenvalues(eigenval_filename) band_structure = BandStructure(eigenvalues=eigenval.eigenvalues, fermi_energy=vasprun.fermi_energy, atoms_map=vasprun.atoms_map, num_bands=procar.num_bands, band_projection=procar) vbm_projection = band_structure.vbm_projection() vbm_df = projection_to_df(vbm_projection) correction_indexes = get_fractionary_correction_indexes(vbm_df, treshold=12) assert correction_indexes["C"][0] == "p" assert len(correction_indexes["Ge"]) == 0