def runningTaskList(self): # print ('RUNNING_TASK_MEMORY RUNNING_TASK_MEMORY',RUNNING_TASK_MEMORY) for num, tempRS in enumerate(RUNNING_TASK_MEMORY): tempStat = RUNNING_TASK_MEMORY[num] data_details = autoMLutilities.readStatusFile(tempRS['idforData']) # print (tempStat.keys()) for j in data_details.keys(): tempStat[j] = data_details[j] # print ('Status call data_details.keys()',tempStat.keys()) try: projectName = tempRS['idforData'] logFolder = 'logs/' data_details[ 'generationInfo'] = autoMLutilities.progressOfModel( logFolder, projectName) tempStat['generationInfo'] = data_details['generationInfo'] try: data_details = autoMLutilities.readStatusFile( tempRS['idforData']) if data_details['listOfModelAccuracy'] != []: tempStat['generationInfo'] = data_details[ 'listOfModelAccuracy'] except: pass except: pass statusOfProject = data_details['status'] tempStat['status'] = statusOfProject try: # print ('ppppppppppp >>>>>>>>',1) if tempStat['type'] == 'NNProject': tempStat['url'] = data_details['tensorboardUrl'] # print ('ppppppppppp >>>>>>>>',3) if data_details['errorMessage']: tempStat['errorMessage'] = data_details['errorMessage'] # print ('ppppppppppp >>>>>>>>',4) if tempStat['errorTraceback']: tempStat['errorTraceback'] = data_details['errorTraceback'] # print ('ppppppppppp >>>>>>>>',5) RUNNING_TASK_MEMORY[num] = tempStat # print ('RUNNING_TASK_MEMORY hhaha',RUNNING_TASK_MEMORY) except: pass runTaskListSorted = sorted(RUNNING_TASK_MEMORY, key=itemgetter('createdOn'), reverse=True) # print (runTaskListSorted[0].keys()) runningTask = {'runningTask': runTaskListSorted} return JsonResponse(runningTask, status=200)
def statusOfModel(idforData): try: projectName = idforData # print ('STep 1') data_details = autoMLutilities.readStatusFile(projectName) # print ('STep 2') data_details['generationInfo'] = autoMLutilities.progressOfModel( logFolder, projectName) # print ('STep 3') except: projectName = idforData # print ('STep 1') data_details = autoMLutilities.readStatusFile(projectName) # print ('STep 2') # print ('MMMMMMMMMMMM',data_details) # for j in data_details: # print (j,type(data_details[j])) return JsonResponse(data_details, status=200)
def runningTaskList(): for num, tempRS in enumerate(RUNNING_TASK_MEMORY): try: data_details = autoMLutilities.readStatusFile( tempRS['idforData']) statusOfProject = data_details['status'] tempStat = RUNNING_TASK_MEMORY[num] tempStat['status'] = statusOfProject if tempStat['type'] == 'NNProject': tempStat['url'] = data_details['tensorboardUrl'] if data_details['errorMessage']: tempStat['errorMessage'] = data_details['errorMessage'] if tempStat['errorTraceback']: tempStat['errorTraceback'] = data_details['errorTraceback'] RUNNING_TASK_MEMORY[num] = tempStat except: pass runTaskListSorted = sorted(RUNNING_TASK_MEMORY, key=itemgetter('createdOn'), reverse=True) runningTask = {'runningTask': runTaskListSorted} return JsonResponse(runningTask, status=200)