16
16
17
17
@numba .jit (nopython = True , nogil = True , parallel = False )
18
18
def add_var (
19
- val : float , nobs : int , mean_x : float , ssqdm_x : float , compensation : float ,
20
- num_consecutive_same_value : int , prev_value : float
19
+ val : float ,
20
+ nobs : int ,
21
+ mean_x : float ,
22
+ ssqdm_x : float ,
23
+ compensation : float ,
24
+ num_consecutive_same_value : int ,
25
+ prev_value : float
21
26
) -> tuple [int , float , float , float , int , float ]:
22
27
if not np .isnan (val ):
23
28
@@ -93,11 +98,22 @@ def sliding_var(
93
98
94
99
for j in range (s , e ):
95
100
val = values [j ]
96
- nobs , mean_x , ssqdm_x , compensation_add , \
97
- num_consecutive_same_value , prev_value = add_var (
98
- val , nobs , mean_x , ssqdm_x , compensation_add ,
99
- num_consecutive_same_value , prev_value
100
- )
101
+ (
102
+ nobs ,
103
+ mean_x ,
104
+ ssqdm_x ,
105
+ compensation_add ,
106
+ num_consecutive_same_value ,
107
+ prev_value ,
108
+ ) = add_var (
109
+ val ,
110
+ nobs ,
111
+ mean_x ,
112
+ ssqdm_x ,
113
+ compensation_add ,
114
+ num_consecutive_same_value ,
115
+ prev_value ,
116
+ )
101
117
else :
102
118
for j in range (start [i - 1 ], s ):
103
119
val = values [j ]
@@ -107,11 +123,22 @@ def sliding_var(
107
123
108
124
for j in range (end [i - 1 ], e ):
109
125
val = values [j ]
110
- nobs , mean_x , ssqdm_x , compensation_add , \
111
- num_consecutive_same_value , prev_value = add_var (
112
- val , nobs , mean_x , ssqdm_x , compensation_add ,
113
- num_consecutive_same_value , prev_value
114
- )
126
+ (
127
+ nobs ,
128
+ mean_x ,
129
+ ssqdm_x ,
130
+ compensation_add ,
131
+ num_consecutive_same_value ,
132
+ prev_value ,
133
+ ) = add_var (
134
+ val ,
135
+ nobs ,
136
+ mean_x ,
137
+ ssqdm_x ,
138
+ compensation_add ,
139
+ num_consecutive_same_value ,
140
+ prev_value ,
141
+ )
115
142
116
143
if nobs >= min_periods and nobs > ddof :
117
144
if nobs == 1 or num_consecutive_same_value >= nobs :
0 commit comments