Indeed you get the warning message above. The warning is due to the fact that your first element in the energies array is 0 and you use it in the equation:
l = (speed_of_light*planck_constant/energies).inUnitsOf(nanoMeter)
However, it is just a warning and you do get some results in the plot you posted at the beginning.
You are just plotting the data in the "wrong" range which is defined by the two lines in the refrac.py script (which was used to study the properties of Silicon):
ax.axis([180,1000,2.2,6.4])
ax.axis([180,1000,0,0.24])
you can comment the lines or choose to plot in a different range, for example:
ax.axis([0,4000, 0.6,1.6])
ax.axis([0,4000, 0.,0.01])