From f9d91ff879efc5315fd7d1763dd86680ec1c2f9b Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Mon, 11 Jul 2022 15:03:08 -0400 Subject: [PATCH 1/3] edit error message for unequal times --- pvlib/tools.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pvlib/tools.py b/pvlib/tools.py index 61e6d170c4..dd5730ee6f 100644 --- a/pvlib/tools.py +++ b/pvlib/tools.py @@ -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) From 4916ae9da6c29b231e61d0b1ec400bd18f294eb4 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Mon, 11 Jul 2022 15:39:04 -0400 Subject: [PATCH 2/3] similar edits to prilliman docstring --- pvlib/temperature.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pvlib/temperature.py b/pvlib/temperature.py index 6a4ed1fd6e..68a2869914 100644 --- a/pvlib/temperature.py +++ b/pvlib/temperature.py @@ -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 ---------- From 870943cffb3d0992375f0d558be5ee88e16c51eb Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Mon, 11 Jul 2022 15:39:31 -0400 Subject: [PATCH 3/3] whatsnew --- docs/sphinx/source/whatsnew/v0.9.2.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.9.2.rst b/docs/sphinx/source/whatsnew/v0.9.2.rst index 028b905003..d887d85de8 100644 --- a/docs/sphinx/source/whatsnew/v0.9.2.rst +++ b/docs/sphinx/source/whatsnew/v0.9.2.rst @@ -11,6 +11,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 ~~~~~~~~~ @@ -51,4 +54,5 @@ Contributors * Chencheng Luo (:ghuser:`roger-lcc`) * Prajwal Borkar (:ghuser:`PrajwalBorkar`) * Kevin Anderson (:ghuser:`kanderso-nrel`) -* Cliff Hansen (:ghuser:`cwhanse`) \ No newline at end of file +* Cliff Hansen (:ghuser:`cwhanse`) +* Will Hobbs (:ghuser:`williamhobbs`)