MCPcopy Create free account
hub / github.com/Kitware/VTK / BatchTest

Function BatchTest

Common/Core/Testing/Python/TestEmptyInput.py:420–445  ·  view source on GitHub ↗

Batch the classes into groups of batchSize. :param: batchNo - if the set of classes is a subgroup then this is the index of the subgroup. :param: batchSize - if the set of classes is a subgroup then this is the size of the subgroup.

(vtkClasses, batchNo, batchSize)

Source from the content-addressed store, hash-verified

418 idx += 1
419
420def BatchTest(vtkClasses, batchNo, batchSize):
421 '''
422 Batch the classes into groups of batchSize.
423
424 :param: batchNo - if the set of classes is a subgroup then this
425 is the index of the subgroup.
426 :param: batchSize - if the set of classes is a subgroup then this
427 is the size of the subgroup.
428 '''
429 idx = 0
430 total = 0;
431 batch = set()
432 for a in vtkClasses:
433 currentBatchNo = idx // batchSize;
434 if currentBatchNo == batchNo:
435 batch.add(a)
436 total += 1
437 if total == batchSize:
438 TestEmptyInput(batch, batchNo, batchSize)
439 print(total)
440 batch = set()
441 total = 0
442 idx += 1
443 if batch:
444 TestEmptyInput(batch, batchNo, batchSize)
445 print(total)
446
447def PrintResultSummary():
448 print('-' * 40)

Callers

nothing calls this directly

Calls 4

TestEmptyInputFunction · 0.70
setFunction · 0.50
printFunction · 0.50
addMethod · 0.45

Tested by

no test coverage detected