Skip to content

Commit 41bcbfc

Browse files
committed
Apply suggestions from @neutrinoceros
1 parent 080456d commit 41bcbfc

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

bottleneck/src/move_template.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ MOVE(move_mean, DTYPE0) {
182182
floating-point errors from unnecessary arithmetic */
183183
if (window == 1) {
184184
WHILE2 {
185-
ai = AI(DTYPE0);
186-
YI(DTYPE0) = ai;
185+
YI(DTYPE0) = AI(DTYPE0);
187186
}
188187
} else {
189188
WHILE2 {

bottleneck/tests/move_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,19 +220,19 @@ def test_move_std_sqrt():
220220

221221
def test_move_mean_window_1():
222222
"""Test move_mean with window=1, min_count=1 (issue #437).
223-
223+
224224
When window=1 and min_count=1, move_mean should return the input array
225225
unchanged, since a moving average with window size 1 is the identity
226-
function. However, the current implementation introduces small floating
227-
point errors.
228-
226+
function. However a previous, general purpose implementation introduced small
227+
floating point errors.
228+
229229
See: https://github.com/pydata/bottleneck/issues/437
230230
"""
231231
# Minimal test case from issue #437 (simplified from 119 to 3 elements)
232232
a = [0.008196721311475436, -0.01626016260162607, 0.012396694214876205]
233-
233+
234234
b = bn.move_mean(a, window=1, min_count=1)
235-
235+
236236
# With window=1, the result should be exactly equal to the input
237237
err_msg = (
238238
"move_mean with window=1 and min_count=1 should return the input array "

0 commit comments

Comments
 (0)