diff python/moving.py @ 635:6ae68383071e

corrected issue with tests requiring shapely, adding a separate test file
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 24 Mar 2015 14:17:12 +0100
parents f410c8fb07b7
children 3058e00887bc
line wrap: on
line diff
--- a/python/moving.py	Tue Mar 24 14:02:14 2015 +0100
+++ b/python/moving.py	Tue Mar 24 14:17:12 2015 +0100
@@ -1180,7 +1180,9 @@
 
     @staticmethod
     def computePET(obj1, obj2, collisionDistanceThreshold):
-        '''Post-encroachment time based on distance threshold'''
+        '''Post-encroachment time based on distance threshold
+
+        Returns the smallest time difference when the object positions are within collisionDistanceThreshold'''
         #for i in xrange(int(obj1.length())-1):
         #    for j in xrange(int(obj2.length())-1):
         #        inter = segmentIntersection(obj1.getPositionAt(i), obj1.getPositionAt(i+1), obj2.getPositionAt(i), obj2.getPositionAt(i+1))
@@ -1554,3 +1556,6 @@
     unittest.TextTestRunner().run(suite)
     #doctest.testmod()
     #doctest.testfile("example.txt")
+    if shapelyAvailable: 
+        suite = doctest.DocFileSuite('tests/moving_shapely.txt')
+        unittest.TextTestRunner().run(suite)