Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update sonogram.py
Browse files- sonogram.py +2 -13
sonogram.py
CHANGED
|
@@ -232,18 +232,12 @@ class Sonogram():
|
|
| 232 |
duration = 0
|
| 233 |
tracking = False
|
| 234 |
for stepClass,timeIncrement,members in zip(timeStepClass,st,timeStepMembers):
|
| 235 |
-
print(currList)
|
| 236 |
-
print(stepClass,timeIncrement,members)
|
| 237 |
if stepClass == c:
|
| 238 |
-
print(1)
|
| 239 |
if currMembers == members:
|
| 240 |
-
print(2)
|
| 241 |
|
| 242 |
duration += min(stepSize,maxTime-timeIncrement)
|
| 243 |
else:
|
| 244 |
-
print(3)
|
| 245 |
if tracking:
|
| 246 |
-
print(4)
|
| 247 |
singleDimList.append((currMembers,Segment(start,start+duration)))
|
| 248 |
currList.append((currMembers,Segment(start,start+duration)))
|
| 249 |
if start+duration > endTime:
|
|
@@ -257,9 +251,7 @@ class Sonogram():
|
|
| 257 |
duration += min(stepSize,maxTime-timeIncrement)
|
| 258 |
tracking = True
|
| 259 |
else:
|
| 260 |
-
print(5)
|
| 261 |
if tracking:
|
| 262 |
-
print(6)
|
| 263 |
singleDimList.append((currMembers,Segment(start,start+duration)))
|
| 264 |
currList.append((currMembers,Segment(start,start+duration)))
|
| 265 |
if start+duration > endTime:
|
|
@@ -276,11 +268,8 @@ class Sonogram():
|
|
| 276 |
categorySegmentList.append(currList)
|
| 277 |
# Check where we left off
|
| 278 |
if endTime != maxTime:
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
if maxTime-st[-1] > stepSize:
|
| 282 |
-
singleDimList.append((None,Segment(start,start+duration)))
|
| 283 |
-
categorySegmentList[2].append((None,Segment(st[-1] + stepSize,maxTime)))
|
| 284 |
|
| 285 |
# For debug
|
| 286 |
singleDimList = sorted(singleDimList,key=lambda index : index[1].start)
|
|
|
|
| 232 |
duration = 0
|
| 233 |
tracking = False
|
| 234 |
for stepClass,timeIncrement,members in zip(timeStepClass,st,timeStepMembers):
|
|
|
|
|
|
|
| 235 |
if stepClass == c:
|
|
|
|
| 236 |
if currMembers == members:
|
|
|
|
| 237 |
|
| 238 |
duration += min(stepSize,maxTime-timeIncrement)
|
| 239 |
else:
|
|
|
|
| 240 |
if tracking:
|
|
|
|
| 241 |
singleDimList.append((currMembers,Segment(start,start+duration)))
|
| 242 |
currList.append((currMembers,Segment(start,start+duration)))
|
| 243 |
if start+duration > endTime:
|
|
|
|
| 251 |
duration += min(stepSize,maxTime-timeIncrement)
|
| 252 |
tracking = True
|
| 253 |
else:
|
|
|
|
| 254 |
if tracking:
|
|
|
|
| 255 |
singleDimList.append((currMembers,Segment(start,start+duration)))
|
| 256 |
currList.append((currMembers,Segment(start,start+duration)))
|
| 257 |
if start+duration > endTime:
|
|
|
|
| 268 |
categorySegmentList.append(currList)
|
| 269 |
# Check where we left off
|
| 270 |
if endTime != maxTime:
|
| 271 |
+
singleDimList.append((None,Segment(endTime,maxTime)))
|
| 272 |
+
categorySegmentList[2].append((None,Segment(endTime,maxTime)))
|
|
|
|
|
|
|
|
|
|
| 273 |
|
| 274 |
# For debug
|
| 275 |
singleDimList = sorted(singleDimList,key=lambda index : index[1].start)
|