Mercurial Hosting > traffic-intelligence
diff trafficintelligence/utils.py @ 1059:a87b3072bd26
working version
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 11 Jul 2018 01:48:42 -0400 |
parents | 16575ca4537d |
children | c04550f957ab |
line wrap: on
line diff
--- a/trafficintelligence/utils.py Tue Jul 10 17:16:38 2018 -0400 +++ b/trafficintelligence/utils.py Wed Jul 11 01:48:42 2018 -0400 @@ -342,6 +342,10 @@ def timeToFrames(t, frameRate): return frameRate*(t.hour*3600+t.minute*60+t.second) +def timeModulo(t, duration): + 'returns the time modulo the duration in min' + return time(t.hour, t.minute//duration, t.second) + def sortXY(X,Y): 'returns the sorted (x, Y(x)) sorted on X' D = {}