-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
The Array API standard makes it possible to write generic code that works with many types of arrays (NumPy, Tensorflow, PyTorch, Dask, JAX, CuPy, MXNet, Xarray, ...). In principle, this would enable a pvlib simulation to be run in parallel, or on a GPU, using only code that looks very similar to the numpy-style code we are familiar with.
The Array API standard is gaining some meaningful traction in the community. For example, SciPy is adding support: see their array types tag, progress tracking tables, and developer documentation. scikit-learn is working on it too.
Adopting the standard could be a fairly straightforward way of enabling new use cases for pvlib. However, I don't have any experience with it myself and can't say anything more concrete than it seems worth looking into. So, following discussion with @echedey-ls, a good first step here is to explore the cost and benefit by prototyping compatibility in a small number of representative pvlib functions (I leave it an open question which functions might be considered representative). That would inform decisions about whether and how to pursue broader adoption across pvlib.
For reference, I copy this description from our GSoC 2025 project ideas list:
Project Title: Compatibility with the Array API
Project Description: An exciting development in the Python ecosystem is the Python array API standard, a uniform interface across the various array libraries (NumPy, Xarray, JAX, etc). Historically, pvlib has been written for compatibility with NumPy arrays and Pandas Series, but making use of the Array API to expand compatibility to other array libraries could be very beneficial. A successful proposal for this project will include some investigation about what it would take to adopt the Array API across pvlib.
Expected Outcomes: A plan/roadmap for adopting the Array API, Array API compatibility in several pvlib modules, and automated tests ensuring compatibility across the various array packages.