From dea155faf40f1564950b6b3463843ae4fc2ddb5c Mon Sep 17 00:00:00 2001 From: karlhillx Date: Mon, 22 Jun 2026 19:29:50 -0400 Subject: [PATCH 1/2] Fix interval keyword argument in oedi_9068 gallery example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #2791. The oedi_9068 gallery example calls get_nsrdb_psm4_conus() with interval=5, but the function's parameter is named time_step (the interval name comes from the NSRDB API query string, not the Python signature). This was missed when PR #2582 migrated the example from get_psm3 (which used interval) to get_nsrdb_psm4_conus (which uses time_step). Changes interval=5 to time_step=5 in the example call. No test changes needed — test_get_nsrdb_psm4_conus_5min already exercises time_step=5 against the function directly. --- docs/examples/system-models/oedi_9068.py | 3 ++- docs/sphinx/source/whatsnew/v0.15.3.rst | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/examples/system-models/oedi_9068.py b/docs/examples/system-models/oedi_9068.py index 9a73bfa9ce..8294843353 100644 --- a/docs/examples/system-models/oedi_9068.py +++ b/docs/examples/system-models/oedi_9068.py @@ -145,7 +145,8 @@ 'albedo', 'precipitable_water'] psm3, psm3_metadata = pvlib.iotools.get_nsrdb_psm4_conus(latitude, longitude, api_key, email, - year=2019, interval=5, + year=2019, + time_step=5, parameters=keys, map_variables=True, leap_day=True) diff --git a/docs/sphinx/source/whatsnew/v0.15.3.rst b/docs/sphinx/source/whatsnew/v0.15.3.rst index 87ded069ee..754f1d367f 100644 --- a/docs/sphinx/source/whatsnew/v0.15.3.rst +++ b/docs/sphinx/source/whatsnew/v0.15.3.rst @@ -23,6 +23,9 @@ Enhancements Documentation ~~~~~~~~~~~~~ +* Fixed broken ``interval`` keyword argument in the ``oedi_9068`` gallery + example; the correct parameter name is ``time_step``. (:issue:`2791`) + Testing ~~~~~~~ From 07b3917771c1931c5aad941fece9e61e31bfa8b2 Mon Sep 17 00:00:00 2001 From: karlhillx Date: Tue, 23 Jun 2026 19:35:51 -0400 Subject: [PATCH 2/2] =?UTF-8?q?Apply=20review=20feedback:=20update=20PSM3?= =?UTF-8?q?=E2=86=92PSM4=20references=20and=20add=20contributor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update narrative comments from 'NSRDB PSM3' to 'NSRDB PSM4' to match the actual function called (get_nsrdb_psm4_conus) - Rename psm3/psm3_metadata variables to psm4/psm4_metadata for consistency with the PSM4 data source - Add Karl Hill to Contributors in v0.15.3 whatsnew Addresses Copilot suggestions (+1 from @cwhanse) on PR #2793. --- docs/examples/system-models/oedi_9068.py | 20 ++++++++++---------- docs/sphinx/source/whatsnew/v0.15.3.rst | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/examples/system-models/oedi_9068.py b/docs/examples/system-models/oedi_9068.py index 8294843353..d2f8f6ae79 100644 --- a/docs/examples/system-models/oedi_9068.py +++ b/docs/examples/system-models/oedi_9068.py @@ -7,7 +7,7 @@ """ # %% # This example model uses satellite-based solar resource data from the -# NSRDB PSM3. This approach is useful for pre-construction energy modeling +# NSRDB PSM4. This approach is useful for pre-construction energy modeling # and in retrospective analyses where the system’s own irradiance # measurements are not present or unreliable. # @@ -135,7 +135,7 @@ # # The system does have measured plane-of-array irradiance data, but the # measurements suffer from row-to-row shading and tracker stalls. In this -# example, we will use weather data taken from the NSRDB PSM3 for the year +# example, we will use weather data taken from the NSRDB PSM4 for the year # 2019. api_key = 'DEMO_KEY' @@ -143,7 +143,7 @@ keys = ['ghi', 'dni', 'dhi', 'temp_air', 'wind_speed', 'albedo', 'precipitable_water'] -psm3, psm3_metadata = pvlib.iotools.get_nsrdb_psm4_conus(latitude, longitude, +psm4, psm4_metadata = pvlib.iotools.get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year=2019, time_step=5, @@ -168,12 +168,12 @@ # module fraction and returns the average irradiance over the total module # surface. -solar_position = location.get_solarposition(psm3.index) +solar_position = location.get_solarposition(psm4.index) tracker_angles = mount.get_orientation( solar_position['apparent_zenith'], solar_position['azimuth'] ) -dni_extra = pvlib.irradiance.get_extra_radiation(psm3.index) +dni_extra = pvlib.irradiance.get_extra_radiation(psm4.index) # note: this system is monofacial, so only calculate irradiance for the # front side: @@ -181,7 +181,7 @@ tracker_angles['surface_tilt'], tracker_angles['surface_azimuth'], solar_position['apparent_zenith'], solar_position['azimuth'], gcr, axis_height, pitch, - psm3['ghi'], psm3['dhi'], psm3['dni'], psm3['albedo'], + psm4['ghi'], psm4['dhi'], psm4['dni'], psm4['albedo'], model='haydavies', dni_extra=dni_extra, ) @@ -192,14 +192,14 @@ cell_temperature_steady_state = pvlib.temperature.faiman( poa_global=averaged_irradiance['poa_global'], - temp_air=psm3['temp_air'], - wind_speed=psm3['wind_speed'], + temp_air=psm4['temp_air'], + wind_speed=psm4['wind_speed'], **temperature_model_parameters, ) cell_temperature = pvlib.temperature.prilliman( cell_temperature_steady_state, - psm3['wind_speed'], + psm4['wind_speed'], unit_mass=module_unit_mass ) @@ -216,7 +216,7 @@ 'poa_direct': averaged_irradiance['poa_direct'], 'poa_diffuse': averaged_irradiance['poa_diffuse'], 'cell_temperature': cell_temperature, - 'precipitable_water': psm3['precipitable_water'], # for the spectral model + 'precipitable_water': psm4['precipitable_water'], # for the spectral model }) model.run_model_from_poa(weather_inputs) diff --git a/docs/sphinx/source/whatsnew/v0.15.3.rst b/docs/sphinx/source/whatsnew/v0.15.3.rst index 754f1d367f..fa03a1dc59 100644 --- a/docs/sphinx/source/whatsnew/v0.15.3.rst +++ b/docs/sphinx/source/whatsnew/v0.15.3.rst @@ -45,4 +45,5 @@ Maintenance Contributors ~~~~~~~~~~~~ +* Karl Hill (:ghuser:`karlhillx`)