@@ -242,14 +242,19 @@ def bishop88_i_from_v(voltage, photocurrent, saturation_current,
242242 breakdown_exp : float, default 3.28
243243 avalanche breakdown exponent :math:`m` [unitless]
244244 method : str, default 'newton'
245- Either ``'newton'``, ``'brentq'``, or ``'chandrupatla'`` (requires
246- scipy 1.15 or greater). ''method'' must be ``'newton'``
247- if ``breakdown_factor`` is not 0.
245+ Either ``'newton'``, ``'brentq'``, or ``'chandrupatla'``.
246+ ''method'' must be ``'newton'`` if ``breakdown_factor`` is not 0.
247+
248+ .. note::
249+ ``'chandrupatla'`` requires scipy 1.15 or greater.
250+
248251 method_kwargs : dict, optional
249- Keyword arguments passed to root finder method. See
250- :py:func:`scipy:scipy.optimize.brentq`,
251- :py:func:`scipy:scipy.optimize.newton`, and
252- :py:func:`scipy:scipy.optimize.elementwise.find_root` (when ``method='chandrupatla'``) for parameters.
252+ Keyword arguments passed to the root finder. For options, see:
253+
254+ * ``method='brentq'``: :py:func:`scipy:scipy.optimize.brentq`
255+ * ``method='newton'``: :py:func:`scipy:scipy.optimize.newton`
256+ * ``method='chandrupatla'``: :py:func:`scipy:scipy.optimize.elementwise.find_root`
257+
253258 ``'full_output': True`` is allowed, and ``optimizer_output`` would be
254259 returned. See examples section.
255260
@@ -288,7 +293,7 @@ def bishop88_i_from_v(voltage, photocurrent, saturation_current,
288293 .. [1] "Computer simulation of the effects of electrical mismatches in
289294 photovoltaic cell interconnection circuits" JW Bishop, Solar Cell (1988)
290295 :doi:`10.1016/0379-6787(88)90059-2`
291- """
296+ """ # noqa: E501
292297 # collect args
293298 args = (photocurrent , saturation_current ,
294299 resistance_series , resistance_shunt , nNsVth , d2mutau , NsVbi ,
@@ -336,11 +341,11 @@ def vd_from_brent(voc, v, iph, isat, rs, rsh, gamma, d2mutau, NsVbi,
336341 except ModuleNotFoundError as e :
337342 # TODO remove this when our minimum scipy version is >=1.15
338343 msg = (
339- "method='chandrupatla' requires scipy v1.15 or greater. "
340- "Select another method, or update your version of scipy . "
341- f"( { str ( e ) } ) "
344+ "method='chandrupatla' requires scipy v1.15 or greater "
345+ "(available for Python 3.10+) . "
346+ "Select another method, or update your version of scipy. "
342347 )
343- raise ImportError (msg )
348+ raise ImportError (msg ) from e
344349
345350 voc_est = estimate_voc (photocurrent , saturation_current , nNsVth )
346351 shape = _shape_of_max_size (voltage , voc_est )
@@ -409,13 +414,19 @@ def bishop88_v_from_i(current, photocurrent, saturation_current,
409414 breakdown_exp : float, default 3.28
410415 avalanche breakdown exponent :math:`m` [unitless]
411416 method : str, default 'newton'
412- Either ``'newton'``, ``'brentq'``, or ``'chandrupatla'`` (requires
413- scipy 1.15 or greater). ''method'' must be ``'newton'``
414- if ``breakdown_factor`` is not 0.
417+ Either ``'newton'``, ``'brentq'``, or ``'chandrupatla'``.
418+ ''method'' must be ``'newton'`` if ``breakdown_factor`` is not 0.
419+
420+ .. note::
421+ ``'chandrupatla'`` requires scipy 1.15 or greater.
422+
415423 method_kwargs : dict, optional
416- Keyword arguments passed to root finder method. See
417- :py:func:`scipy:scipy.optimize.brentq` and
418- :py:func:`scipy:scipy.optimize.newton` parameters.
424+ Keyword arguments passed to the root finder. For options, see:
425+
426+ * ``method='brentq'``: :py:func:`scipy:scipy.optimize.brentq`
427+ * ``method='newton'``: :py:func:`scipy:scipy.optimize.newton`
428+ * ``method='chandrupatla'``: :py:func:`scipy:scipy.optimize.elementwise.find_root`
429+
419430 ``'full_output': True`` is allowed, and ``optimizer_output`` would be
420431 returned. See examples section.
421432
@@ -454,7 +465,7 @@ def bishop88_v_from_i(current, photocurrent, saturation_current,
454465 .. [1] "Computer simulation of the effects of electrical mismatches in
455466 photovoltaic cell interconnection circuits" JW Bishop, Solar Cell (1988)
456467 :doi:`10.1016/0379-6787(88)90059-2`
457- """
468+ """ # noqa: E501
458469 # collect args
459470 args = (photocurrent , saturation_current ,
460471 resistance_series , resistance_shunt , nNsVth , d2mutau , NsVbi ,
@@ -502,11 +513,11 @@ def vd_from_brent(voc, i, iph, isat, rs, rsh, gamma, d2mutau, NsVbi,
502513 except ModuleNotFoundError as e :
503514 # TODO remove this when our minimum scipy version is >=1.15
504515 msg = (
505- "method='chandrupatla' requires scipy v1.15 or greater (available for Python3.10+). "
506- "Select another method, or update your version of scipy . "
507- f"( { str ( e ) } ) "
516+ "method='chandrupatla' requires scipy v1.15 or greater "
517+ "(available for Python 3.10+) . "
518+ "Select another method, or update your version of scipy. "
508519 )
509- raise ImportError (msg )
520+ raise ImportError (msg ) from e
510521
511522 shape = _shape_of_max_size (current , voc_est )
512523 vlo = np .zeros (shape )
@@ -571,13 +582,19 @@ def bishop88_mpp(photocurrent, saturation_current, resistance_series,
571582 breakdown_exp : numeric, default 3.28
572583 avalanche breakdown exponent :math:`m` [unitless]
573584 method : str, default 'newton'
574- Either ``'newton'``, ``'brentq'``, or ``'chandrupatla'`` (requires
575- scipy 1.15 or greater). ''method'' must be ``'newton'``
576- if ``breakdown_factor`` is not 0.
585+ Either ``'newton'``, ``'brentq'``, or ``'chandrupatla'``.
586+ ''method'' must be ``'newton'`` if ``breakdown_factor`` is not 0.
587+
588+ .. note::
589+ ``'chandrupatla'`` requires scipy 1.15 or greater.
590+
577591 method_kwargs : dict, optional
578- Keyword arguments passed to root finder method. See
579- :py:func:`scipy:scipy.optimize.brentq` and
580- :py:func:`scipy:scipy.optimize.newton` parameters.
592+ Keyword arguments passed to the root finder. For options, see:
593+
594+ * ``method='brentq'``: :py:func:`scipy:scipy.optimize.brentq`
595+ * ``method='newton'``: :py:func:`scipy:scipy.optimize.newton`
596+ * ``method='chandrupatla'``: :py:func:`scipy:scipy.optimize.elementwise.find_root`
597+
581598 ``'full_output': True`` is allowed, and ``optimizer_output`` would be
582599 returned. See examples section.
583600
@@ -617,7 +634,7 @@ def bishop88_mpp(photocurrent, saturation_current, resistance_series,
617634 .. [1] "Computer simulation of the effects of electrical mismatches in
618635 photovoltaic cell interconnection circuits" JW Bishop, Solar Cell (1988)
619636 :doi:`10.1016/0379-6787(88)90059-2`
620- """
637+ """ # noqa: E501
621638 # collect args
622639 args = (photocurrent , saturation_current ,
623640 resistance_series , resistance_shunt , nNsVth , d2mutau , NsVbi ,
@@ -663,17 +680,17 @@ def fmpp(x, *a):
663680 except ModuleNotFoundError as e :
664681 # TODO remove this when our minimum scipy version is >=1.15
665682 msg = (
666- "method='chandrupatla' requires scipy v1.15 or greater. "
667- "Select another method, or update your version of scipy . "
668- f"( { str ( e ) } ) "
683+ "method='chandrupatla' requires scipy v1.15 or greater "
684+ "(available for Python 3.10+) . "
685+ "Select another method, or update your version of scipy. "
669686 )
670- raise ImportError (msg )
687+ raise ImportError (msg ) from e
671688
672689 vlo = np .zeros_like (photocurrent )
673690 vhi = np .full_like (photocurrent , voc_est )
674691 kwargs_trimmed = method_kwargs .copy ()
675692 kwargs_trimmed .pop ("full_output" , None ) # not valid for find_root
676-
693+
677694 result = find_root (fmpp ,
678695 (vlo , vhi ),
679696 args = args ,
0 commit comments