Skip to content

Commit 351ef58

Browse files
committed
feat: add test for series with 1 obs
1 parent f218a9a commit 351ef58

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

‎tsfeatures/tests/test_small_ts.py‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
entropy, flat_spots, heterogeneity, holt_parameters,
66
lumpiness, nonlinearity, pacf_features, stl_features,
77
stability, hw_parameters, unitroot_kpss, unitroot_pp,
8-
series_length, sparsity, hurst
8+
series_length, sparsity, hurst, statistics
99
)
1010

1111

@@ -17,8 +17,20 @@ def test_small():
1717
entropy, flat_spots, holt_parameters,
1818
lumpiness, nonlinearity, pacf_features, stl_features,
1919
stability, hw_parameters, unitroot_kpss, unitroot_pp,
20-
series_length, hurst]
20+
series_length, hurst, statistics]
21+
feats_df = tsfeatures(z_df, freq=12, features=feats, scale=False)
22+
23+
def test_small_1():
24+
z = np.zeros(1)
25+
z[-1] = 1
26+
z_df = pd.DataFrame({'unique_id': 1, 'ds': range(1, 2), 'y': z})
27+
feats=[sparsity, acf_features, arch_stat, crossing_points,
28+
entropy, flat_spots, holt_parameters,
29+
lumpiness, nonlinearity, pacf_features, stl_features,
30+
stability, hw_parameters, unitroot_kpss, unitroot_pp,
31+
series_length, hurst, statistics]
2132
feats_df = tsfeatures(z_df, freq=12, features=feats, scale=False)
2233

2334
if __name__=="__main__":
2435
test_small()
36+
test_small_1()

0 commit comments

Comments
 (0)