def v_from_i(resistance_shunt, resistance_series, nNsVth, current,<EOL>saturation_current, photocurrent, method='<STR_LIT>'):
if method.lower() == '<STR_LIT>':<EOL><INDENT>return _singlediode._lambertw_v_from_i(<EOL>resistance_shunt, resistance_series, nNsVth, current,<EOL>saturation_current, photocurrent<EOL>)<EOL><DEDENT>else:<EOL><INDENT>args = (current, photocurrent, saturation_current,<EOL>resistance_series, resistance_shunt, nNsVth)<EOL>V = _singlediode.bishop88_v_from_i(*args, method=method.lower())<EOL>size, shape = _singlediode._get_size_and_shape(args)<EOL>if size <= <NUM_LIT:1>:<EOL><INDENT>if shape is not None:<EOL><INDENT>V = np.tile(V, shape)<EOL><DEDENT><DEDENT>if np.isnan(V).any() and size <= <NUM_LIT:1>:<EOL><INDENT>V = np.repeat(V, size)<EOL>if shape is not None:<EOL><INDENT>V = V.reshape(shape)<EOL><DEDENT><DEDENT>return V<EOL><DEDENT>
Device voltage at the given device current for the single diode model.

Uses the single diode model (SDM) as described in, e.g.,
 Jain and Kapoor 2004 [1].
The solution is per Eq 3 of [1] except when resistance_shunt=numpy.inf,
 in which case the explict solution for voltage is used.
Ideal device parameters are specified by resistance_shunt=np.inf and
 resistance_series=0.
Inputs to this function can include scalars and pandas.Series, but it is
 the caller's responsibility to ensure that the arguments are all float64
 and within the proper ranges.

Parameters
----------
resistance_shunt : numeric
    Shunt resistance in ohms under desired IV curve conditions.
    Often abbreviated ``Rsh``.
    0 < resistance_shunt <= numpy.inf

resistance_series : numeric
    Series resistance in ohms under desired IV curve conditions.
    Often abbreviated ``Rs``.
    0 <= resistance_series < numpy.inf

nNsVth : numeric
    The product of three components. 1) The usual diode ideal factor
    (n), 2) the number of cells in series (Ns), and 3) the cell
    thermal voltage under the desired IV curve conditions (Vth). The
    thermal voltage of the cell (in volts) may be calculated as
    ``k*temp_cell/q``, where k is Boltzmann's constant (J/K),
    temp_cell is the temperature of the p-n junction in Kelvin, and
    q is the charge of an electron (coulombs).
    0 < nNsVth

current : numeric
    The current in amperes under desired IV curve conditions.

saturation_current : numeric
    Diode saturation current in amperes under desired IV curve
    conditions. Often abbreviated ``I_0``.
    0 < saturation_current

photocurrent : numeric
    Light-generated current (photocurrent) in amperes under desired
    IV curve conditions. Often abbreviated ``I_L``.
    0 <= photocurrent

method : str
    Method to use: ``'lambertw'``, ``'newton'``, or ``'brentq'``. *Note*:
    ``'brentq'`` is limited to 1st quadrant only.

Returns
-------
current : np.ndarray or scalar

References
----------
[1] A. Jain, A. Kapoor, "Exact analytical solutions of the
parameters of real solar cells using Lambert W-function", Solar
Energy Materials and Solar Cells, 81 (2004) 269-277.