Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
630e584
Fix deprecated inplace operations
echedey-ls Oct 23, 2026
889bcb1
Fix Pandas4Warning: .dayofyear -> .day_of_year
echedey-ls Oct 24, 2026
9f3ae9b
Fix Pandas4Warning: deprecated passing a list to DataFrame.from_dict …
echedey-ls Oct 24, 2026
279dec7
Fix Pandas4Warning: assert_index_equal will check the 'freq' attribute
echedey-ls Oct 24, 2026
b2aba02
Fix pandas 3.1.0 unexpected behavior on .map (may defer until pandas …
echedey-ls Oct 25, 2026
65371c8
Fix Pandas4Warning: DatetimeIndex.values will change from UTC ndarray…
echedey-ls Oct 25, 2026
4045155
Fix previous commit - use localize to ignore tz, and not fail when in…
echedey-ls Oct 25, 2026
10b9c30
Fix prior Pandas4Warning - we need a writable array, not just a ro view
echedey-ls Oct 25, 2026
3f64bb6
Fix error in prior commit due to check_freq nonexistent in pandas<3.1.0
echedey-ls Oct 25, 2026
bd73b06
Fix style issues - flake8
echedey-ls Oct 25, 2026
b629916
Fix check_freq not in pandas<3.1.0; iotools
echedey-ls Oct 25, 2026
058848c
Fix check_freq not in pandas<3.1.0; iotools (II)
echedey-ls Oct 25, 2026
6a656c1
Review: tidy check_freq logic
echedey-ls Oct 26, 2026
db5f399
Whatsnew
echedey-ls Oct 26, 2026
7380eab
Merge branch 'main' into dev/breaking-news-pandas3.1
echedey-ls Oct 26, 2026
d112038
Fix _check_pandas_assert_kwargs test (after tidying code)
echedey-ls Oct 27, 2026
a6ec50d
Fix index check_freq implementation and tests
echedey-ls Oct 27, 2026
1c6c0c7
Fix Pandas4Warning - Series.values returning an ndarray that drops ti…
echedey-ls Oct 27, 2026
8df4f73
Fix Pandas4Warning: A future version of pandas will return a BaseOffs…
echedey-ls Oct 27, 2026
8ccdb20
Review: Fix Pandas4Warning: assert_index_equal will use check_freq by…
echedey-ls Oct 28, 2026
277674c
Appease flake8 warnings from #2924
echedey-ls Oct 28, 2026
a2a8579
Merge branch 'main' into dev/breaking-news-pandas3.1
echedey-ls Oct 28, 2026
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
9 changes: 6 additions & 3 deletions pvlib/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,10 @@ def _get_sample_intervals(times, win_length):
)

# determine if we can proceed
if (_pandas_infer_freq_BaseOffset_transition_handler(times)
and len(np.unique(deltas)) == 1):
if ( # infer wrapper is None if no freq is determined
_pandas_infer_freq_BaseOffset_transition_handler(times)
and len(np.unique(deltas)) == 1
):
sample_interval = times[1] - times[0]
sample_interval = sample_interval.seconds / 60 # in minutes
samples_per_window = int(win_length / sample_interval)
Expand Down Expand Up @@ -476,7 +478,7 @@ def _pandas_infer_freq_BaseOffset_transition_handler(times):
[^1]: pandas PR GH#64679: https://github.com/pandas-dev/pandas/pull/64679
[^2]: https://pandas.pydata.org/docs/reference/api/pandas.infer_freq.html
[^3]: https://pandas.pydata.org/docs/reference/api/pandas.tseries.offsets.BaseOffset.html
"""
""" # noqa: E501
if Version(pd.__version__) < Version("3.1.0rc0"):
return pd.infer_freq(times)
with pd.option_context({'future.infer_freq_returns_offset': True}):
Expand All @@ -485,6 +487,7 @@ def _pandas_infer_freq_BaseOffset_transition_handler(times):
# base_offset:=None if unable to infer
return getattr(base_offset, "freqstr", None)


def _degrees_to_index(degrees, coordinate):
"""Transform input degrees to an output index integer.
Specify a degree value and either 'latitude' or 'longitude' to get
Expand Down
9 changes: 6 additions & 3 deletions tests/test_solarposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,13 +831,16 @@ def test_sun_rise_set_transit_geometric(expected_rise_set_spa, golden_mst):
test_transit = solarposition._times_to_hours_after_local_midnight(st)
# convert expected SPA sunrise, sunset, transit to local datetime indices
expected_sunrise = pd.DatetimeIndex(
expected_rise_set_spa["sunrise"].dt.tz_convert(None).to_numpy(), tz="UTC"
expected_rise_set_spa["sunrise"].dt.tz_convert(None).to_numpy(),
tz="UTC",
).tz_convert(golden_mst.tz)
expected_sunset = pd.DatetimeIndex(
expected_rise_set_spa["sunset"].dt.tz_convert(None).to_numpy(), tz="UTC"
expected_rise_set_spa["sunset"].dt.tz_convert(None).to_numpy(),
tz="UTC",
).tz_convert(golden_mst.tz)
expected_transit = pd.DatetimeIndex(
expected_rise_set_spa["transit"].dt.tz_convert(None).to_numpy(), tz="UTC"
expected_rise_set_spa["transit"].dt.tz_convert(None).to_numpy(),
tz="UTC",
).tz_convert(golden_mst.tz)
# convert expected times to hours since midnight as arrays of floats
expected_sunrise = solarposition._times_to_hours_after_local_midnight(
Expand Down
Loading