Mercurial > hg > nsaunier > traffic-intelligence
diff trafficintelligence/tests/moving.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 | fe35473acee3 |
| children | f3574e43c238 |
line wrap: on
line diff
--- a/trafficintelligence/tests/moving.txt Wed Jul 17 12:28:01 2024 -0400 +++ b/trafficintelligence/tests/moving.txt Sat Jul 20 20:35:21 2024 -0400 @@ -187,10 +187,10 @@ >>> from utils import LCSS >>> lcss = LCSS(lambda x,y: Point.distanceNorm2(x,y) <= 0.1) >>> Trajectory.lcss(t1, t1, lcss) -3 +np.int64(3) >>> lcss = LCSS(lambda p1, p2: (p1-p2).normMax() <= 0.1) >>> Trajectory.lcss(t1, t1, lcss) -3 +np.int64(3) >>> p1=Point(0,0) >>> p2=Point(1,0) @@ -253,18 +253,18 @@ Number of objects represented by object 1 must be greater or equal to 1 (0.5) >>> o2 = MovingObject.generate(2, Point(0.,-5.), Point(0.,1.), TimeInterval(0,10)) >>> MovingObject.computePET(o1, o2, 0.1) -(0.0, 5, 5) +(np.float64(0.0), np.int64(5), np.int64(5)) >>> o2 = MovingObject.generate(2, Point(0.,-5.), Point(0.,1.), TimeInterval(5,15)) >>> MovingObject.computePET(o1, o2, 0.1) -(5.0, 5, 10) +(np.float64(5.0), np.int64(5), np.int64(10)) >>> o2 = MovingObject.generate(2, Point(0.,-5.), Point(0.,1.), TimeInterval(15,30)) >>> MovingObject.computePET(o1, o2, 0.1) -(15.0, 5, 20) +(np.float64(15.0), np.int64(5), np.int64(20)) >>> o1 = MovingObject(1, TimeInterval(0,10), features=[MovingObject.generate(1, Point(0., 3.), Point(1., 0.), TimeInterval(0,10)), MovingObject.generate(2, Point(2., 3.), Point(1., 0.), TimeInterval(0,10)), MovingObject.generate(3, Point(2., 4.), Point(1., 0.), TimeInterval(0,10)), MovingObject.generate(4, Point(0., 4.), Point(1., 0.), TimeInterval(0,10))]) >>> o2 = MovingObject(2, TimeInterval(0,10), features=[MovingObject.generate(5, Point(6., 0.), Point(0., 1.), TimeInterval(0,10)), MovingObject.generate(6, Point(7., 0.), Point(0., 1.), TimeInterval(0,10)), MovingObject.generate(7, Point(7., 2.), Point(0., 1.), TimeInterval(0,10)), MovingObject.generate(8, Point(6., 2.), Point(0., 1.), TimeInterval(0,10))]) >>> MovingObject.computePET(o1, o2, useBoundingPoly = True) -(2.0, 5, 3) +(np.float64(2.0), np.int64(5), np.int64(3)) >>> t1 = CurvilinearTrajectory.generate(3, 1., 10, 'b') >>> t1.length() @@ -335,7 +335,7 @@ True >>> t=5 >>> o13.getPositionAtInstant(t) == (o1.getPositionAtInstant(t)+o3.getPositionAtInstant(t)).divide(2) -True +np.True_ >>> len(o13.getFeatures()) 2 @@ -379,11 +379,11 @@ True >>> o15.updatePositions() >>> o1.getPositionAtInstant(10) == o15.getPositionAtInstant(10) -True +np.True_ >>> f15.getPositionAtInstant(11) == o15.getPositionAtInstant(11) -True +np.True_ >>> o5.getPositionAtInstant(12) == o15.getPositionAtInstant(12) -True +np.True_ >>> o1 = MovingObject.generate(1, Point(0., 2.), Point(0., 1.), TimeInterval(0,2)) >>> o1.classifyUserTypeSpeedMotorized(0.5, np.median)
