Skip to content

Commit c9bbdbb

Browse files
authored
Improve nonuniform timestamps error message for prilliman and detect_clearsky (#1490)
* edit error message for unequal times * similar edits to prilliman docstring * whatsnew
1 parent 3f397ed commit c9bbdbb

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

docs/sphinx/source/whatsnew/v0.9.2.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Enhancements
1414
* Add :py:func:`pvlib.tracking.calc_surface_orientation` for calculating
1515
single-axis tracker ``surface_tilt`` and ``surface_azimuth`` from
1616
rotation angles. (:issue:`1471`, :pull:`1480`)
17+
* Improve error message about uneven time intervals for
18+
:py:func:`~pvlib.clearsky.detect_clearsky` and :py:func:`~pvlib.temperature.prilliman`
19+
(:issue:`1476`, :pull:`1490`)
1720

1821
Bug fixes
1922
~~~~~~~~~
@@ -59,3 +62,4 @@ Contributors
5962
* Cliff Hansen (:ghuser:`cwhanse`)
6063
* Jules Chéron (:ghuser:`jules-ch`)
6164
* Kurt Rhee (:ghuser:`kurt-rhee`)
65+
* Will Hobbs (:ghuser:`williamhobbs`)

pvlib/temperature.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,8 @@ def prilliman(temp_cell, wind_speed, unit_mass=11.1, coefficients=None):
839839
.. warning::
840840
This implementation requires the time series inputs to be regularly
841841
sampled in time with frequency less than 20 minutes. Data with
842-
irregular time steps should be resampled prior to using this function.
842+
irregular time steps (including from data gaps, missing leap days,
843+
etc) should be resampled prior to using this function.
843844
844845
Parameters
845846
----------

pvlib/tools.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,5 +406,9 @@ def _get_sample_intervals(times, win_length):
406406
samples_per_window = int(win_length / sample_interval)
407407
return sample_interval, samples_per_window
408408
else:
409-
raise NotImplementedError('algorithm does not yet support unequal '
410-
'times. consider resampling your data.')
409+
message = (
410+
'algorithm does not yet support unequal time intervals. consider '
411+
'resampling your data and checking for gaps from missing '
412+
'periods, leap days, etc.'
413+
)
414+
raise NotImplementedError(message)

0 commit comments

Comments
 (0)