def bishop88_v_from_i(current, photocurrent, saturation_current,<EOL>resistance_series, resistance_shunt, nNsVth,<EOL>method='<STR_LIT>'):
<EOL>args = (photocurrent, saturation_current, resistance_series,<EOL>resistance_shunt, nNsVth)<EOL>voc_est = estimate_voc(photocurrent, saturation_current, nNsVth)<EOL>def fi(x, i, *a):<EOL><INDENT>return bishop88(x, *a)[<NUM_LIT:0>] - i<EOL><DEDENT>if method.lower() == '<STR_LIT>':<EOL><INDENT>def vd_from_brent(voc, i, iph, isat, rs, rsh, gamma):<EOL><INDENT>return brentq(fi, <NUM_LIT:0.0>, voc, args=(i, iph, isat, rs, rsh, gamma))<EOL><DEDENT>vd_from_brent_vectorized = np.vectorize(vd_from_brent)<EOL>vd = vd_from_brent_vectorized(voc_est, current, *args)<EOL><DEDENT>elif method.lower() == '<STR_LIT>':<EOL><INDENT>args, v0 = _prepare_newton_inputs((current,), args, voc_est)<EOL>vd = newton(func=lambda x, *a: fi(x, current, *a), x0=v0,<EOL>fprime=lambda x, *a: bishop88(x, *a, gradients=True)[<NUM_LIT:3>],<EOL>args=args)<EOL><DEDENT>else:<EOL><INDENT>raise NotImplementedError("<STR_LIT>" % method)<EOL><DEDENT>return bishop88(vd, *args)[<NUM_LIT:1>]<EOL>
Find voltage given any current.

Parameters
----------
current : numeric
    current (I) in amperes [A]
photocurrent : numeric
    photogenerated current (Iph or IL) in amperes [A]
saturation_current : numeric
    diode dark or saturation current (Io or Isat) in amperes [A]
resistance_series : numeric
    series resistance (Rs) in ohms
resistance_shunt : numeric
    shunt resistance (Rsh) in ohms
nNsVth : numeric
    product of diode ideality factor (n), number of series cells (Ns), and
    thermal voltage (Vth = k_b * T / q_e) in volts [V]
method : str
    one of two optional search methods: either ``'brentq'``, a reliable and
    bounded method or ``'newton'`` which is the default.

Returns
-------
voltage : numeric
    voltage (V) at the specified current (I) in volts [V]