Line 431 needs to be changed like this:
Value = transmission_spectrum.current().inUnitsOf(Ampere)*1.e9
The reason is that transmission_spectrum.current
just points to the Python method "current", while transmission_spectrum.current()
executes the method and returns the value of the current. The makes sure the stored value of the current is in units of nA.