From fa7c2451c18d5ec921aee84a5ad9dd841aac8aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Echedey=20Luis=20=C3=81lvarez?= <80125792+echedey-ls@users.noreply.github.com> Date: Wed, 21 Jan 2026 18:08:37 +0100 Subject: [PATCH 1/9] .resample('m') -> .resample('ME') Broken on pandas v3.0.0 v2.1 docs https://pandas.pydata.org/pandas-docs/version/2.1/user_guide/timeseries.html#dateoffset-objects v3.0 docs https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#dateoffset-objects Related to #2600 --- .../irradiance-transposition/plot_transposition_gain.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/examples/irradiance-transposition/plot_transposition_gain.py b/docs/examples/irradiance-transposition/plot_transposition_gain.py index e0b7031f0b..b9e06126e6 100644 --- a/docs/examples/irradiance-transposition/plot_transposition_gain.py +++ b/docs/examples/irradiance-transposition/plot_transposition_gain.py @@ -80,7 +80,7 @@ def calculate_poa(tmy, solar_position, surface_tilt, surface_azimuth): column_name = f"FT-{tilt}" # TMYs are hourly, so we can just sum up irradiance [W/m^2] to get # insolation [Wh/m^2]: - df_monthly[column_name] = poa_irradiance.resample('m').sum() + df_monthly[column_name] = poa_irradiance.resample('ME').sum() # single-axis tracking: orientation = tracking.singleaxis(solar_position['apparent_zenith'], @@ -95,10 +95,10 @@ def calculate_poa(tmy, solar_position, surface_tilt, surface_azimuth): solar_position, orientation['surface_tilt'], orientation['surface_azimuth']) -df_monthly['SAT-0.4'] = poa_irradiance.resample('m').sum() +df_monthly['SAT-0.4'] = poa_irradiance.resample('ME').sum() # calculate the percent difference from GHI -ghi_monthly = tmy['ghi'].resample('m').sum() +ghi_monthly = tmy['ghi'].resample('ME').sum() df_monthly = 100 * (df_monthly.divide(ghi_monthly, axis=0) - 1) df_monthly.plot() From b44000de5b20440fe1e3441e630a6820dd870c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Echedey=20Luis=20=C3=81lvarez?= <80125792+echedey-ls@users.noreply.github.com> Date: Wed, 21 Jan 2026 18:13:19 +0100 Subject: [PATCH 2/9] .shift(freq="-30T") -> .shift(freq="-30min") --- .../agrivoltaics/plot_diffuse_PAR_Spitters_relationship.py | 2 +- docs/examples/irradiance-decomposition/plot_diffuse_fraction.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/examples/agrivoltaics/plot_diffuse_PAR_Spitters_relationship.py b/docs/examples/agrivoltaics/plot_diffuse_PAR_Spitters_relationship.py index 97ebe860a6..31e80bd9a2 100644 --- a/docs/examples/agrivoltaics/plot_diffuse_PAR_Spitters_relationship.py +++ b/docs/examples/agrivoltaics/plot_diffuse_PAR_Spitters_relationship.py @@ -57,7 +57,7 @@ solar_position = pvlib.solarposition.get_solarposition( # TMY timestamp is at end of hour, so shift to center of interval - tmy.index.shift(freq="-30T"), + tmy.index.shift(freq="-30min"), latitude=metadata["latitude"], longitude=metadata["longitude"], altitude=metadata["altitude"], diff --git a/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py b/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py index 166e0c1f42..7eb11a53f5 100644 --- a/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py +++ b/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py @@ -35,7 +35,7 @@ # NOTE: TMY3 files timestamps indicate the end of the hour, so shift indices # back 30-minutes to calculate solar position at center of the interval solpos = get_solarposition( - greensboro.index.shift(freq="-30T"), latitude=metadata['latitude'], + greensboro.index.shift(freq="-30min"), latitude=metadata['latitude'], longitude=metadata['longitude'], altitude=metadata['altitude'], pressure=greensboro.pressure*100, # convert from millibar to Pa temperature=greensboro.temp_air) From 4705b32d0d8245fd8df36b234f3a1991d5a12035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Echedey=20Luis=20=C3=81lvarez?= <80125792+echedey-ls@users.noreply.github.com> Date: Wed, 21 Jan 2026 18:14:12 +0100 Subject: [PATCH 3/9] freq='1T' -> freq='1min' --- benchmarks/benchmarks/scaling.py | 2 +- docs/examples/bifacial/plot_bifi_model_mc.py | 2 +- docs/examples/bifacial/plot_bifi_model_pvwatts.py | 2 +- docs/examples/bifacial/plot_pvfactors_fixed_tilt.py | 2 +- .../plot_simple_irradiance_adjustment_for_horizon_shading.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/benchmarks/benchmarks/scaling.py b/benchmarks/benchmarks/scaling.py index 8c2ed1471b..feeb9c60e2 100644 --- a/benchmarks/benchmarks/scaling.py +++ b/benchmarks/benchmarks/scaling.py @@ -15,7 +15,7 @@ def setup(self): lon = np.array((4.99, 5, 5.01)) self.coordinates = np.array([(lati, loni) for (lati, loni) in zip(lat, lon)]) - self.times = pd.date_range('2019-01-01', freq='1T', periods=self.n) + self.times = pd.date_range('2019-01-01', freq='1min', periods=self.n) self.positions = np.array([[0, 0], [100, 0], [100, 100], [0, 100]]) self.clearsky_index = pd.Series(np.random.rand(self.n), index=self.times) diff --git a/docs/examples/bifacial/plot_bifi_model_mc.py b/docs/examples/bifacial/plot_bifi_model_mc.py index 679ff22921..f40e4e5d7b 100644 --- a/docs/examples/bifacial/plot_bifi_model_mc.py +++ b/docs/examples/bifacial/plot_bifi_model_mc.py @@ -40,7 +40,7 @@ # create site location and times characteristics lat, lon = 36.084, -79.817 tz = 'Etc/GMT+5' -times = pd.date_range('2021-06-21', '2021-6-22', freq='1T', tz=tz) +times = pd.date_range('2021-06-21', '2021-6-22', freq='1min', tz=tz) # create site system characteristics axis_tilt = 0 diff --git a/docs/examples/bifacial/plot_bifi_model_pvwatts.py b/docs/examples/bifacial/plot_bifi_model_pvwatts.py index 76a813fd4c..b6a6a582fb 100644 --- a/docs/examples/bifacial/plot_bifi_model_pvwatts.py +++ b/docs/examples/bifacial/plot_bifi_model_pvwatts.py @@ -32,7 +32,7 @@ # using Greensboro, NC for this example lat, lon = 36.084, -79.817 tz = 'Etc/GMT+5' -times = pd.date_range('2021-06-21', '2021-06-22', freq='1T', tz=tz) +times = pd.date_range('2021-06-21', '2021-06-22', freq='1min', tz=tz) # create location object and get clearsky data site_location = location.Location(lat, lon, tz=tz, name='Greensboro, NC') diff --git a/docs/examples/bifacial/plot_pvfactors_fixed_tilt.py b/docs/examples/bifacial/plot_pvfactors_fixed_tilt.py index 63d7db902a..28b06110c2 100644 --- a/docs/examples/bifacial/plot_pvfactors_fixed_tilt.py +++ b/docs/examples/bifacial/plot_pvfactors_fixed_tilt.py @@ -30,7 +30,7 @@ # %% # First, generate the usual modeling inputs: -times = pd.date_range('2021-06-21', '2021-06-22', freq='1T', tz='Etc/GMT+5') +times = pd.date_range('2021-06-21', '2021-06-22', freq='1min', tz='Etc/GMT+5') loc = location.Location(latitude=40, longitude=-80, tz=times.tz) sp = loc.get_solarposition(times) cs = loc.get_clearsky(times) diff --git a/docs/examples/shading/plot_simple_irradiance_adjustment_for_horizon_shading.py b/docs/examples/shading/plot_simple_irradiance_adjustment_for_horizon_shading.py index 9b608ac734..7aa868fe6c 100644 --- a/docs/examples/shading/plot_simple_irradiance_adjustment_for_horizon_shading.py +++ b/docs/examples/shading/plot_simple_irradiance_adjustment_for_horizon_shading.py @@ -27,7 +27,7 @@ # Set times in the morning of the December solstice. times = pd.date_range( - '2020-12-20 6:30', '2020-12-20 9:00', freq='1T', tz=tz + '2020-12-20 6:30', '2020-12-20 9:00', freq='1min', tz=tz ) # Create location object, and get solar position and clearsky irradiance data. From 62f97d879a111566afa8ace30fd55b33830bbf5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Echedey=20Luis=20=C3=81lvarez?= <80125792+echedey-ls@users.noreply.github.com> Date: Wed, 21 Jan 2026 18:16:30 +0100 Subject: [PATCH 4/9] freq='H' -> freq='h' --- docs/examples/solar-position/plot_sunpath_diagrams.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/examples/solar-position/plot_sunpath_diagrams.py b/docs/examples/solar-position/plot_sunpath_diagrams.py index f6f237c706..282a8dee43 100644 --- a/docs/examples/solar-position/plot_sunpath_diagrams.py +++ b/docs/examples/solar-position/plot_sunpath_diagrams.py @@ -24,7 +24,7 @@ tz = 'Asia/Calcutta' lat, lon = 28.6, 77.2 -times = pd.date_range('2019-01-01 00:00:00', '2020-01-01', freq='H', tz=tz) +times = pd.date_range('2019-01-01 00:00:00', '2020-01-01', freq='h', tz=tz) solpos = solarposition.get_solarposition(times, lat, lon) # remove nighttime solpos = solpos.loc[solpos['apparent_elevation'] > 0, :] @@ -112,7 +112,7 @@ tz = 'Asia/Calcutta' lat, lon = 28.6, 77.2 -times = pd.date_range('2019-01-01 00:00:00', '2020-01-01', freq='H', tz=tz) +times = pd.date_range('2019-01-01 00:00:00', '2020-01-01', freq='h', tz=tz) solpos = solarposition.get_solarposition(times, lat, lon) # remove nighttime From 2425393d997b049585ca0f4bbfa0961ce2e451b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Echedey=20Luis=20=C3=81lvarez?= <80125792+echedey-ls@users.noreply.github.com> Date: Wed, 21 Jan 2026 18:23:42 +0100 Subject: [PATCH 5/9] resample('m') -> resample('ME') [2 - another file] --- docs/examples/irradiance-transposition/plot_seasonal_tilt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/irradiance-transposition/plot_seasonal_tilt.py b/docs/examples/irradiance-transposition/plot_seasonal_tilt.py index dc4b433412..53e75cadc1 100644 --- a/docs/examples/irradiance-transposition/plot_seasonal_tilt.py +++ b/docs/examples/irradiance-transposition/plot_seasonal_tilt.py @@ -96,6 +96,6 @@ def get_orientation(self, solar_zenith, solar_azimuth): 'Seasonal 20/40 Production': mc.results.ac, 'Fixed 30 Production': mc2.results.ac, }) -results.resample('m').sum().plot() +results.resample('ME').sum().plot() plt.ylabel('Monthly Production') plt.show() From 592c7a8812cd62b73a0532593e110db43e8ab310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Echedey=20Luis=20=C3=81lvarez?= <80125792+echedey-ls@users.noreply.github.com> Date: Wed, 21 Jan 2026 18:25:36 +0100 Subject: [PATCH 6/9] shift(freq='-30T') -> shift(freq='-30min') [2 - missed entry] --- docs/examples/floating-pv/plot_floating_pv_cell_temperature.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/floating-pv/plot_floating_pv_cell_temperature.py b/docs/examples/floating-pv/plot_floating_pv_cell_temperature.py index c1b7c93f97..f7ecbd7d88 100644 --- a/docs/examples/floating-pv/plot_floating_pv_cell_temperature.py +++ b/docs/examples/floating-pv/plot_floating_pv_cell_temperature.py @@ -140,7 +140,7 @@ solar_position = pvlib.solarposition.get_solarposition( # TMY timestamp is at end of hour, so shift to center of interval - tmy.index.shift(freq='-30T'), + tmy.index.shift(freq='-30min'), latitude=metadata['latitude'], longitude=metadata['longitude'], altitude=metadata['altitude'], From 5f4b96b8e642c766bf2dccf852076597dfabeafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Echedey=20Luis=20=C3=81lvarez?= <80125792+echedey-ls@users.noreply.github.com> Date: Wed, 21 Jan 2026 18:28:30 +0100 Subject: [PATCH 7/9] pandas.read_csv param delim_whitespace removed Fix per https://pandas.pydata.org/pandas-docs/stable/whatsnew/v3.0.0.html (find text delim_whitespace) Issue/discussion: https://github.com/pandas-dev/pandas/issues/55569 --- docs/examples/adr-pvarray/plot_fit_to_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/adr-pvarray/plot_fit_to_matrix.py b/docs/examples/adr-pvarray/plot_fit_to_matrix.py index b256262664..9fec2d5e3c 100644 --- a/docs/examples/adr-pvarray/plot_fit_to_matrix.py +++ b/docs/examples/adr-pvarray/plot_fit_to_matrix.py @@ -51,7 +51,7 @@ 25 1000 75.0 273.651 26 1100 75.0 301.013 ''' -df = pd.read_csv(StringIO(iec61853data), delim_whitespace=True) +df = pd.read_csv(StringIO(iec61853data), sep=r"\s+") # %% # From 95fc5cc81469e6472366fcf9f875192bd4cacea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Echedey=20Luis=20=C3=81lvarez?= <80125792+echedey-ls@users.noreply.github.com> Date: Thu, 22 Jan 2026 21:59:01 +0100 Subject: [PATCH 8/9] Update v0.14.1.rst --- docs/sphinx/source/whatsnew/v0.14.1.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/sphinx/source/whatsnew/v0.14.1.rst b/docs/sphinx/source/whatsnew/v0.14.1.rst index 3a15193886..e3fc9d6959 100644 --- a/docs/sphinx/source/whatsnew/v0.14.1.rst +++ b/docs/sphinx/source/whatsnew/v0.14.1.rst @@ -22,6 +22,7 @@ Enhancements Documentation ~~~~~~~~~~~~~ +- Examples have been updated to work with ``pandas==3``. Testing From 008dc872225f2942112b85b90855cf7d13ae7ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Echedey=20Luis=20=C3=81lvarez?= <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 23 Jan 2026 09:36:38 +0100 Subject: [PATCH 9/9] Whatsnew rewording in imperative mood As per https://common-changelog.org/ --- docs/sphinx/source/whatsnew/v0.14.1.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.14.1.rst b/docs/sphinx/source/whatsnew/v0.14.1.rst index e3fc9d6959..94ce0f3bd0 100644 --- a/docs/sphinx/source/whatsnew/v0.14.1.rst +++ b/docs/sphinx/source/whatsnew/v0.14.1.rst @@ -22,7 +22,7 @@ Enhancements Documentation ~~~~~~~~~~~~~ -- Examples have been updated to work with ``pandas==3``. +- Update gallery examples to work with ``pandas==3``. Testing