From 92cc733939bf36a585258e03de2da00f20fb0be2 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Mon, 14 Feb 2022 15:57:11 -0500 Subject: [PATCH 1/3] allow sub-daily input to YoY --- rdtools/degradation.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/rdtools/degradation.py b/rdtools/degradation.py index eacc7714..59e1413a 100644 --- a/rdtools/degradation.py +++ b/rdtools/degradation.py @@ -225,12 +225,6 @@ def degradation_year_on_year(energy_normalized, recenter=True, energy_normalized.name = 'energy' energy_normalized.index.name = 'dt' - # Detect sub-daily data: - if min(np.diff(energy_normalized.index.values, n=1)) < \ - np.timedelta64(23, 'h'): - raise ValueError('energy_normalized must not be ' - 'more frequent than daily') - # Detect less than 2 years of data if energy_normalized.index[-1] - energy_normalized.index[0] < \ pd.Timedelta('730d'): From e9a8eaed267990a09851297074e883a917dcab8d Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Mon, 14 Feb 2022 15:57:21 -0500 Subject: [PATCH 2/3] remove troublesome leap days --- rdtools/degradation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rdtools/degradation.py b/rdtools/degradation.py index 59e1413a..b1add571 100644 --- a/rdtools/degradation.py +++ b/rdtools/degradation.py @@ -239,6 +239,9 @@ def degradation_year_on_year(energy_normalized, recenter=True, else: renorm = 1.0 + is_leap_day = energy_normalized.index.strftime('%m-%d') == '02-28' + energy_normalized = energy_normalized.loc[~is_leap_day, :] + energy_normalized = energy_normalized.reset_index() energy_normalized['energy'] = energy_normalized['energy'] / renorm From 965db2cf999aba87f9ca57dc8de1b6c430bab19a Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Mon, 14 Feb 2022 16:03:30 -0500 Subject: [PATCH 3/3] whoops --- rdtools/degradation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdtools/degradation.py b/rdtools/degradation.py index b1add571..7f08d9bc 100644 --- a/rdtools/degradation.py +++ b/rdtools/degradation.py @@ -240,7 +240,7 @@ def degradation_year_on_year(energy_normalized, recenter=True, renorm = 1.0 is_leap_day = energy_normalized.index.strftime('%m-%d') == '02-28' - energy_normalized = energy_normalized.loc[~is_leap_day, :] + energy_normalized = energy_normalized.loc[~is_leap_day] energy_normalized = energy_normalized.reset_index() energy_normalized['energy'] = energy_normalized['energy'] / renorm