Skip to content

Commit 4eb70e1

Browse files
committed
correct cut/paste/delete errors
1 parent 0eda545 commit 4eb70e1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pvlib/tests/test_clearsky.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -661,26 +661,27 @@ def test__max_diff_windowed(detect_clearsky_helper_data):
661661
expected = {}
662662
expected['max_diff'] = pd.Series(
663663
data=[np.nan, 3., 5., 7., 9., 11., np.nan], index=x.index)
664-
result = clearsky._line_length_windowed(
664+
result = clearsky._max_diff_windowed(
665665
x, H, samples_per_window, sample_interval)
666666
assert_series_equal(result, expected['max_diff'])
667667

668668

669669
def test__calc_stats(detect_clearsky_helper_data):
670670
x, samples_per_window, sample_interval, H = detect_clearsky_helper_data
671-
# stats are hand-computed assuming window = 3 and sample_interval = 1
671+
# stats are hand-computed assuming window = 3, sample_interval = 1,
672+
# and right-aligned labels
672673
mean_x = pd.Series(np.array([np.nan, np.nan, 5, 14, 29, 50, 77]) / 3.)
673674
max_x = pd.Series(np.array([np.nan, np.nan, 4, 9, 16, 25, 36]))
674675
diff_std = np.array([np.nan, np.nan, np.sqrt(2), np.sqrt(2), np.sqrt(2),
675676
np.sqrt(2), np.sqrt(2)])
676677
slope_nstd = diff_std / mean_x
677678
slope = x.diff().shift(-1)
678679
expected = {}
679-
expected['mean'] = mean_x
680-
expected['max'] = max_x
680+
expected['mean'] = mean_x.shift(-1) # shift to align to center
681+
expected['max'] = max_x.shift(-1)
681682
# slope between adjacent points
682683
expected['slope'] = slope
683-
expected['slope_nstd'] = slope_nstd
684+
expected['slope_nstd'] = slope_nstd.shift(-1)
684685
result = clearsky._calc_stats(
685686
x, samples_per_window, sample_interval, H)
686687
res_mean, res_max, res_slope_nstd, res_slope = result

0 commit comments

Comments
 (0)