Fix interval keyword argument in oedi_9068 gallery example#2793
Fix interval keyword argument in oedi_9068 gallery example#2793karlhillx wants to merge 2 commits into
Conversation
Fixes pvlib#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 pvlib#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.
f6a81be to
dea155f
Compare
There was a problem hiding this comment.
Pull request overview
Fixes a broken gallery example invocation of pvlib.iotools.get_nsrdb_psm4_conus() by replacing the incorrect keyword argument interval with the correct Python parameter name time_step, and documents the fix in the v0.15.3 release notes.
Changes:
- Update
oedi_9068gallery example to callget_nsrdb_psm4_conus(..., time_step=5)instead ofinterval=5. - Add a v0.15.3 “what’s new” entry describing the documentation/example fix (Issue #2791).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/sphinx/source/whatsnew/v0.15.3.rst | Adds a release note entry for the fixed gallery example keyword argument. |
| docs/examples/system-models/oedi_9068.py | Fixes the example’s get_nsrdb_psm4_conus call by using time_step instead of interval. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| psm3, psm3_metadata = pvlib.iotools.get_nsrdb_psm4_conus(latitude, longitude, | ||
| api_key, email, | ||
| year=2019, interval=5, | ||
| year=2019, time_step=5, |
| psm3, psm3_metadata = pvlib.iotools.get_nsrdb_psm4_conus(latitude, longitude, | ||
| api_key, email, | ||
| year=2019, interval=5, | ||
| year=2019, time_step=5, |
|
@karlhillx thanks! I'm +1 to both of copilot's suggestions. For future contributions please leave in the checklist from the PR template. If you'd like, please add yourself to the list of contributors at the end of the whatsnew file. |
- 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 pvlib#2793.
|
Thanks @cwhanse! Applied both Copilot suggestions (PSM3→PSM4 narrative + variable rename) and added myself to Contributors in v0.15.3.rst. Re: the failing |
Fixes #2791.
Problem
The
oedi_9068gallery example callsget_nsrdb_psm4_conus()withinterval=5, but the function's parameter is namedtime_step. Theintervalname comes from the NSRDB API query string, not the Python signature — the docstring even notes "Calledintervalin NSRDB API."This was missed when PR #2582 migrated the example from
get_psm3(which usedinterval) toget_nsrdb_psm4_conus(which usestime_step). The maintainer confirmed the fix in #2791.Fix
Changes
interval=5totime_step=5in the example call (one line).Tests
No test changes needed —
test_get_nsrdb_psm4_conus_5minintests/iotools/test_psm4.pyalready exercisestime_step=5against the function directly. The bug was in the gallery example, not the function.