comparison trafficintelligence/tests/indicators.txt @ 1287:76f5693b530c

updated tests for numpy 2
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Sat, 20 Jul 2024 20:35:21 -0400
parents 56d0195d043e
children
comparison
equal deleted inserted replaced
1284:8e30c9a6ac6f 1287:76f5693b530c
19 >>> indic1[2] 19 >>> indic1[2]
20 0 20 0
21 21
22 >>> ttc = SeverityIndicator('TTC', {t:t-1 for t in TimeInterval(1,11)}, mostSevereIsMax = False) 22 >>> ttc = SeverityIndicator('TTC', {t:t-1 for t in TimeInterval(1,11)}, mostSevereIsMax = False)
23 >>> ttc.getMostSevereValue(1) 23 >>> ttc.getMostSevereValue(1)
24 0.0 24 np.float64(0.0)
25 >>> ttc.getMostSevereValue(2) 25 >>> ttc.getMostSevereValue(2)
26 0.5 26 np.float64(0.5)
27 >>> ttc.getMostSevereValue(centile = 10.) 27 >>> ttc.getMostSevereValue(centile = 10.)
28 1.0 28 np.float64(1.0)
29 >>> ttc.mostSevereIsMax = True 29 >>> ttc.mostSevereIsMax = True
30 >>> ttc.getMostSevereValue(1) 30 >>> ttc.getMostSevereValue(1)
31 10.0 31 np.float64(10.0)
32 >>> ttc.getMostSevereValue(2) 32 >>> ttc.getMostSevereValue(2)
33 9.5 33 np.float64(9.5)
34 >>> ttc.getMostSevereValue(centile = 10.) 34 >>> ttc.getMostSevereValue(centile = 10.)
35 9.0 35 np.float64(9.0)
36 36
37 >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]]) 37 >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]])
38 >>> m = indicatorMap([1,2,3], t1, 1) 38 >>> m = indicatorMap([1,2,3], t1, 1)
39 >>> m[(1.0, 3.0)] 39 >>> m[(1.0, 3.0)]
40 2.0 40 np.float64(2.0)
41 >>> m[(2.0, 6.0)] 41 >>> m[(2.0, 6.0)]
42 3.0 42 np.float64(3.0)
43 >>> m[(0.0, 0.0)] 43 >>> m[(0.0, 0.0)]
44 1.0 44 np.float64(1.0)
45 >>> m = indicatorMap([1,2,3], t1, 4) 45 >>> m = indicatorMap([1,2,3], t1, 4)
46 >>> m[(0.0, 1.0)] 46 >>> m[(0.0, 1.0)]
47 3.0 47 np.float64(3.0)
48 >>> m[(0.0, 0.0)] 48 >>> m[(0.0, 0.0)]
49 1.5 49 np.float64(1.5)