human
I am working on the file "PVPY Demo.ipynb".
The first task is:
Recreate the famous efficiency versus bandgap curves for the 4 default illumination spectra. You can always define your own custom spectrum by passing a (2,N) numpy array to the spectra keyword
Can you write Python program for it?
 What is a the Python program you requested?
assistant
#Here is the Python program you requested.

bandgaps = np.linspace(.35,4,125)
spectras = ["AM1.5G", "AM1.5D", "AM0Etr",  "BlackBody",]
for spectra in spectras:
    def effofbandgap(bandgap):
        cell = pvpy.SolarCell(bandgap=bandgap)
        spectrum = pvpy.PhotocurrentSpectrum(spectra=spectra)
        cell.set_illumination(spectrum)
        return cell.get_efficiency() *100
    effciencies = [effofbandgap(bandgap) for bandgap in bandgaps]
    plt.plot(bandgaps, effciencies)
plt.ylabel(r"Single Junction Efficiency")
plt.xlabel("Bandgap Energy (eV)")
plt.legend(spectras)