From 0b40e0c533f39cff5f2ff605d2521e771a38b69d Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Fri, 4 Oct 2024 12:25:26 -0400 Subject: [PATCH] work around pvlib sunrise/set issue (#213) --- pvanalytics/tests/features/test_daytime.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pvanalytics/tests/features/test_daytime.py b/pvanalytics/tests/features/test_daytime.py index cf4f8f59..7f1c4edc 100644 --- a/pvanalytics/tests/features/test_daytime.py +++ b/pvanalytics/tests/features/test_daytime.py @@ -38,13 +38,13 @@ def ac_power_series(): @pytest.fixture def modeled_midday_series(ac_power_series): # Get the modeled sunrise and sunset for the location + dates = ac_power_series.index.normalize().unique() modeled_sunrise_sunset_df = pvlib.solarposition.sun_rise_set_transit_spa( - ac_power_series.index, 39.742, -105.1727) - modeled_sunrise_sunset_df.index = modeled_sunrise_sunset_df.index.date - modeled_sunrise_sunset_df = modeled_sunrise_sunset_df.drop_duplicates() + dates, 39.742, -105.1727) # Take the 'transit' column as the midday point between sunrise and # sunset for each day in the modeled irradiance series modeled_midday_series = modeled_sunrise_sunset_df['transit'] + modeled_midday_series.index = dates.date return modeled_midday_series