Skip to content

Commit 46388d7

Browse files
committed
ruff fix
1 parent e379583 commit 46388d7

1 file changed

Lines changed: 45 additions & 5 deletions

File tree

tests/test_plotting.py

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,15 +501,55 @@ def test_moving_average() -> None:
501501
"""Test the moving_average function."""
502502
data_to_average = np.arange(0, 20)
503503
mov_avg = RATplot.moving_average(data_to_average)
504-
assert mov_avg == [1.5, 2.0, 2.5, 3.0, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 16.0,
505-
16.5, 17.0]
504+
assert mov_avg == [
505+
1.5,
506+
2.0,
507+
2.5,
508+
3.0,
509+
3.5,
510+
4.5,
511+
5.5,
512+
6.5,
513+
7.5,
514+
8.5,
515+
9.5,
516+
10.5,
517+
11.5,
518+
12.5,
519+
13.5,
520+
14.5,
521+
15.5,
522+
16.0,
523+
16.5,
524+
17.0,
525+
]
506526

507527
mov_avg = RATplot.moving_average(data_to_average, window_size=2)
508-
assert mov_avg == [0.0, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 16.5,
509-
17.5, 18.5]
528+
assert mov_avg == [
529+
0.0,
530+
0.5,
531+
1.5,
532+
2.5,
533+
3.5,
534+
4.5,
535+
5.5,
536+
6.5,
537+
7.5,
538+
8.5,
539+
9.5,
540+
10.5,
541+
11.5,
542+
12.5,
543+
13.5,
544+
14.5,
545+
15.5,
546+
16.5,
547+
17.5,
548+
18.5,
549+
]
510550

511551
with pytest.raises(AssertionError):
512552
RATplot.moving_average(data_to_average, window_size=-1)
513553

514554
with pytest.raises(AssertionError):
515-
RATplot.moving_average(data_to_average, window_size=len(data_to_average)+1)
555+
RATplot.moving_average(data_to_average, window_size=len(data_to_average) + 1)

0 commit comments

Comments
 (0)