Skip to content

Improve nonuniform timestamps error message for prilliman and detect_clearsky #1490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions docs/sphinx/source/whatsnew/v0.9.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Enhancements
* Add :py:func:`pvlib.tracking.calc_surface_orientation` for calculating
single-axis tracker ``surface_tilt`` and ``surface_azimuth`` from
rotation angles. (:issue:`1471`, :pull:`1480`)
* Improve error message about uneven time intervals for
:py:func:`~pvlib.clearsky.detect_clearsky` and :py:func:`~pvlib.temperature.prilliman`
(:issue:`1476`, :pull:`1490`)

Bug fixes
~~~~~~~~~
Expand Down Expand Up @@ -59,3 +62,4 @@ Contributors
* Cliff Hansen (:ghuser:`cwhanse`)
* Jules Chéron (:ghuser:`jules-ch`)
* Kurt Rhee (:ghuser:`kurt-rhee`)
* Will Hobbs (:ghuser:`williamhobbs`)
3 changes: 2 additions & 1 deletion pvlib/temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,8 @@ def prilliman(temp_cell, wind_speed, unit_mass=11.1, coefficients=None):
.. warning::
This implementation requires the time series inputs to be regularly
sampled in time with frequency less than 20 minutes. Data with
irregular time steps should be resampled prior to using this function.
irregular time steps (including from data gaps, missing leap days,
etc) should be resampled prior to using this function.

Parameters
----------
Expand Down
8 changes: 6 additions & 2 deletions pvlib/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,5 +406,9 @@ def _get_sample_intervals(times, win_length):
samples_per_window = int(win_length / sample_interval)
return sample_interval, samples_per_window
else:
raise NotImplementedError('algorithm does not yet support unequal '
'times. consider resampling your data.')
message = (
'algorithm does not yet support unequal time intervals. consider '
'resampling your data and checking for gaps from missing '
'periods, leap days, etc.'
)
raise NotImplementedError(message)