Skip to content

Fix interval keyword argument in oedi_9068 gallery example#2793

Open
karlhillx wants to merge 1 commit into
pvlib:mainfrom
karlhillx:fix/oedi-9068-interval-to-time_step
Open

Fix interval keyword argument in oedi_9068 gallery example#2793
karlhillx wants to merge 1 commit into
pvlib:mainfrom
karlhillx:fix/oedi-9068-interval-to-time_step

Conversation

@karlhillx

Copy link
Copy Markdown
Contributor

Fixes #2791.

Problem

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 — the docstring even notes "Called interval in NSRDB API."

This was missed when PR #2582 migrated the example from get_psm3 (which used interval) to get_nsrdb_psm4_conus (which uses time_step). The maintainer confirmed the fix in #2791.

Fix

Changes interval=5 to time_step=5 in the example call (one line).

Tests

No test changes needed — test_get_nsrdb_psm4_conus_5min in tests/iotools/test_psm4.py already exercises time_step=5 against the function directly. The bug was in the gallery example, not the function.

Copilot AI review requested due to automatic review settings June 22, 2026 23:29
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.
@karlhillx karlhillx force-pushed the fix/oedi-9068-interval-to-time_step branch from f6a81be to dea155f Compare June 22, 2026 23:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_9068 gallery example to call get_nsrdb_psm4_conus(..., time_step=5) instead of interval=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.

Comment on lines +146 to +148
psm3, psm3_metadata = pvlib.iotools.get_nsrdb_psm4_conus(latitude, longitude,
api_key, email,
year=2019, interval=5,
year=2019, time_step=5,
Comment on lines +146 to +148
psm3, psm3_metadata = pvlib.iotools.get_nsrdb_psm4_conus(latitude, longitude,
api_key, email,
year=2019, interval=5,
year=2019, time_step=5,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken function call in oedi_9068.py gallery example

2 participants