[50a3f7]: / modules / DataDispatcher / DDManager.py

Download this file

33 lines (27 with data), 1.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#DDManager.py
"""
Deep Learning for Cancer Therapy
Authors:
Kumud Ravisankaran | Valeria Brewer
Ninad Mehta | Suraj Jena
"""
import os
from Queue import *
import time
from multiprocessing import Queue
from Status.Status import Status
class DDManager():
def __init__(self):
self.status = Status("DDManager")
def DispatchData(self,trainPaths,testPaths,dataDispatcherQ):
self.status.message(1,"DispatchData(self,trainPaths,testPaths,dataDispatcherQ)")
while((trainPaths.empty()==True and testPaths.empty()==True) or trainPaths.empty()==True or testPaths.empty()==True):
#entering this loops means that CVManager has not yet added next set of train/test folds to Queues.
time.sleep(1)
#reaching this point means that CVManager has both a test and train fold ready for DD in the Queues
self.trainFold = trainPaths.get()
self.testFold = testPaths.get()
#put the newly generated test and train folds in Admin's data Queue in the order which NNManager wants them
dataDispatcherQ.put(self.trainFold)
dataDispatcherQ.put(self.testFold)
self.status.message(0,"DispatchData(self,trainPaths,testPaths,dataDispatcherQ)")