diff trafficintelligence/tests/utils.txt @ 1250:77fbd0e2ba7d

dltrack works with moving average filtering
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 15 Feb 2024 22:04:35 -0500
parents 4069d8545922
children bae8de98406f
line wrap: on
line diff
--- a/trafficintelligence/tests/utils.txt	Thu Feb 15 14:09:52 2024 -0500
+++ b/trafficintelligence/tests/utils.txt	Thu Feb 15 22:04:35 2024 -0500
@@ -1,5 +1,6 @@
 >>> from trafficintelligence.utils import *
 >>> from trafficintelligence.moving import Point
+>>> from numpy import array, arange
 
 >>> upperCaseFirstLetter('mmmm... donuts')
 'Mmmm... Donuts'
@@ -46,6 +47,15 @@
 >>> values[-1]
 6.0
 
+>>> filterMovingWindow(arange(10), 3)
+array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
+>>> filterMovingWindow(list(range(10)), 3)
+array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
+>>> filterMovingWindow(arange(10.), 3)
+array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
+>>> filterMovingWindow(arange(10.), 2)
+array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
+
 >>> stepPlot([3, 5, 7, 8], 1, 10, 0)
 ([1, 3, 3, 5, 5, 7, 7, 8, 8, 10], [0, 0, 1, 1, 2, 2, 3, 3, 4, 4])