Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/sphinx/source/whatsnew/v0.15.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Deprecations

Bug fixes
~~~~~~~~~
* Fixed :py:func:`pvlib.irradiance.dirint` raising ``KeyError`` with
scalar inputs on pandas >= 2.0. (:pull:`XXXX`, :issue:`2751`)
By :ghuser:`Omesh37`.
* Corrects a bug in :py:func:`pvlib.temperature.fuentes`. If inputs were
data type integer, users can expect modeled cell temperature values to
increase slightly.
Expand Down
8 changes: 8 additions & 0 deletions pvlib/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2109,6 +2109,14 @@ def _dirint_bins(times, kt_prime, zenith, w, delta_kt_prime):
-------
tuple of kt_prime_bin, zenith_bin, w_bin, delta_kt_prime_bin
"""
# Ensure scalar inputs are converted to Series so that boolean masks
# produce a boolean Series rather than a scalar bool.
# Scalar bools cause KeyError in pandas >= 2.0. GH #XXXX
kt_prime = pd.Series(kt_prime, index=times, dtype=float)
zenith = pd.Series(zenith, index=times, dtype=float)
w = pd.Series(w, index=times, dtype=float)
delta_kt_prime = pd.Series(delta_kt_prime, index=times, dtype=float)

# @wholmgren: the following bin assignments use MATLAB's 1-indexing.
# Later, we'll subtract 1 to conform to Python's 0-indexing.

Expand Down
Loading