Skip to content

Use scipy's new optimize.elementwise functions #2497

@kandersolar

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions