Skip to content

Commit 0b40e0c

Browse files
authored
work around pvlib sunrise/set issue (#213)
1 parent c144f6e commit 0b40e0c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pvanalytics/tests/features/test_daytime.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ def ac_power_series():
3838
@pytest.fixture
3939
def modeled_midday_series(ac_power_series):
4040
# Get the modeled sunrise and sunset for the location
41+
dates = ac_power_series.index.normalize().unique()
4142
modeled_sunrise_sunset_df = pvlib.solarposition.sun_rise_set_transit_spa(
42-
ac_power_series.index, 39.742, -105.1727)
43-
modeled_sunrise_sunset_df.index = modeled_sunrise_sunset_df.index.date
44-
modeled_sunrise_sunset_df = modeled_sunrise_sunset_df.drop_duplicates()
43+
dates, 39.742, -105.1727)
4544
# Take the 'transit' column as the midday point between sunrise and
4645
# sunset for each day in the modeled irradiance series
4746
modeled_midday_series = modeled_sunrise_sunset_df['transit']
47+
modeled_midday_series.index = dates.date
4848
return modeled_midday_series
4949

5050

0 commit comments

Comments
 (0)