Skip to content

Use scipy's new optimize.elementwise functions #2497

Closed

Description

@kandersolar

scipy v1.15.0 (Jan 2025) offers two new element-wise optimization functions: scipy.optimize.elementwise.find_root and scipy.optimize.elementwise.find_minimum. (See previous brief discussion of this scipy functionality in #974).

These functions can likely provide significant speed-ups for single-diode equation calculations. For example, rerunning the benchmark in #974 (comment) using the new find_root function gives this timing comparison for bishop88_i_from_v ("chandrupatla" is the new scipy function):

Image

The find_minimum function could likely speed up the lambertw approach as well, although I have not benchmarked it against our _golden_sect_DataFrame function.

The question is: when can we start using these in pvlib? The required scipy version is quite new, and not available for python 3.9. Must we wait a couple years until our minimum scipy is v1.15? Or should we add the functionality now, and just raise an error if the installed version of scipy is insufficient?

Activity

  1. cwhanse commented on Jul 8, 2025

    @cwhanse
    Member

    Or should we add the functionality now, and just raise an error if the installed version of scipy is insufficient?

    I'm in favor, if the error message suggests that the fix is to select a different method or to update scipy.

  2. kandersolar commented on Oct 3, 2025

    @kandersolar
    MemberAuthor

    To-do list for this issue:

    • Add method='chandrupatla' to pvlib.pvsystem functions: singlediode, i_from_v, v_from_i, max_power_point
    • Add method='chandrupatla' to pvlib.singlediode functions: bishop88_mpp, bishop88_v_from_i, bishop88_i_from_v
    • Replace _golden_sect_DataFrame with find_minimum
  3. self-assigned this
    on Oct 3, 2025
  4. added this to the v0.13.2 milestone on Nov 3, 2025
  5. modified the milestones: v0.13.2, v0.14.0 on Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions