ARLO Nester
Classes | Functions
workspace.tools.views.biasManipulation Namespace Reference

Classes

class  SearchQueueTasksForm
 
class  SetJobPriorityForm
 
class  SetJobStatusForm
 

Functions

def AddJobParameters (job, params)
 Add parameters to a Job. More...
 
def GetJobParameters (job)
 Get parameters of a Job. More...
 
def setJobStatus (request, jobId)
 Set a Job's status from the Web UI. More...
 
def setJobPriority (request, jobId)
 Set a Job's, and all of it's child tasks', priority from the Web UI. More...
 
def stopQueuedChildTasks (request, parentJobId)
 Set all of a parent Job's queued children to Stopped. More...
 
def queueStoppedChildTasks (request, parentJobId)
 Set all of a parent Job's stopped children to Queued. More...
 
def queueStoppedTask (request, jobId)
 Set a Job to Queued, only if it is currently Stopped. More...
 
def stopQueuedTask (request, jobId)
 Set a Job to Stopped, only if it is currently Queued. More...
 
def searchQueueTasks (request, projectId)
 Search through the list of QueueTask Jobs, filtering based on the setting in the request's SearchQueueTasksForm. More...
 
def manageJobs (request, projectId)
 
def randomWindowTagging (request, projectId)
 Settings. More...
 
def getRandomWindowTasks (request, projectId)
 supervisedBias = SupervisedTagDiscoveryBias.objects.get(id=biasID) supervisedBias = Jobs.objects.get(id=biasID) project = supervisedBias.project More...
 

Function Documentation

def workspace.tools.views.biasManipulation.AddJobParameters (   job,
  params 
)

Add parameters to a Job.

Note
This will ADD JobParameters, not overwrite or delete existing ones.
Parameters
jobJob object to update
paramsA dictionary of name: value-list pairs of parameters (e.g., {'param1':['value1a', 'value2a']} )
Returns
True on success, False otherwise
def workspace.tools.views.biasManipulation.GetJobParameters (   job)

Get parameters of a Job.

Parameters
jobJob object to update
Returns
None if error, name: value-list dictionary otherwise (e.g., {'param1':['value1a','value2a']} )
def workspace.tools.views.biasManipulation.getRandomWindowTasks (   request,
  projectId 
)

supervisedBias = SupervisedTagDiscoveryBias.objects.get(id=biasID) supervisedBias = Jobs.objects.get(id=biasID) project = supervisedBias.project

logging.info("Deleting Supervised Discovery Bias: biasID = " + biasID.__str__())

results = Meandre.call(MeandreAction.stopSupervisedTagDiscovery, {'id':str(biasID)})

if results[0]: logging.info(results[1]) else: logging.info(results[1])

supervisedBias.wasDeleted = True supervisedBias.save()

return HttpResponseRedirect(settings.URL_PREFIX + '/tools/manageJobs/' + project.id.__str__()) return HttpResponseRedirect(settings.URL_PREFIX + '/tools/userHome')

def deleteUnsupervisedBias(request, biasID): user = request.user unsupervisedBias = UnsupervisedTagDiscoveryBias.objects.get(id=biasID) project = unsupervisedBias.project

logging.info("Deleting Unsupervised Discovery Bias: biasID = " + biasID.__str__())

results = Meandre.call(MeandreAction.stopUnsupervisedTagDiscovery, {'id':str(unsupervisedBias.id)})

if results[0]: logging.info(results[1]) else: logging.info(results[1])

unsupervisedBias.wasDeleted = True unsupervisedBias.save()

return HttpResponseRedirect(settings.URL_PREFIX + '/tools/manageJobs/' + project.id.__str__())

def deleteTagAnalysis(request, biasID): user = request.user bias = TagAnalysisBias.objects.get(id=biasID) project = bias.project

logging.info("Deleting Tag Analysis: biasID = " + biasID.__str__())

results = Meandre.call(MeandreAction.stopTagAnalysis, {'id':str(bias.id)})

if results[0]: logging.info(results[1]) else: logging.info(results[1])

bias.wasDeleted = True bias.save()

return HttpResponseRedirect(settings.URL_PREFIX + '/tools/manageJobs/' + project.id.__str__()) Get a list of Random Window Tasks in a Project.

Parameters
requestThe Django HTTP request. Note that this expects a GET method.
projectIdThe database Id of a Project to search.
Returns
JSON encoded list of dictionary [ {id, name, creationDate, numWindows, windowLength, weight } ].
def workspace.tools.views.biasManipulation.manageJobs (   request,
  projectId 
)
def workspace.tools.views.biasManipulation.queueStoppedChildTasks (   request,
  parentJobId 
)

Set all of a parent Job's stopped children to Queued.

For all children, if status = 'Stopped', update status = 'Queued'.

Parameters
requestThe Django HTTP request object
jobIdThe database id of the parent Job to update
Returns
Django HTTP response object
def workspace.tools.views.biasManipulation.queueStoppedTask (   request,
  jobId 
)

Set a Job to Queued, only if it is currently Stopped.

Parameters
requestThe Django HTTP request object
jobIdThe database id of the Job to update
Returns
Django HTTP response object
def workspace.tools.views.biasManipulation.randomWindowTagging (   request,
  projectId 
)

Settings.

Generate Windows Depending on weight, choose how to generate the windows

def workspace.tools.views.biasManipulation.searchQueueTasks (   request,
  projectId 
)

Search through the list of QueueTask Jobs, filtering based on the setting in the request's SearchQueueTasksForm.

Does not return child jobs, as these are assumed to fall under parents which are returned.

Parameters
requestThe Django HTTP request. Note that this expects a GET with a SearchQueueTasksForm
projectIdThe database Id of a Project to search.
Returns
JSON encoded dictionary {totalTasks, tasksReturned, tasksList}. tasksList is a list of dictionary {taskId, name, typeName, creationDate, status, statusName, projectId, projectName, numChildTasks, childTaskStatuses} childTaskStatuses is a list of dictionary {statusName, numTasks}
def workspace.tools.views.biasManipulation.setJobPriority (   request,
  jobId 
)

Set a Job's, and all of it's child tasks', priority from the Web UI.

This form is shown by other functions, so only a POST is valid here.

Note
Currently only allow for Admin (staff) users.
Parameters
requestThe Django HTTP request object
jobIdThe database id of the Job to update
Returns
Django HTTP response object
def workspace.tools.views.biasManipulation.setJobStatus (   request,
  jobId 
)

Set a Job's status from the Web UI.

This form is shown by other functions, so only a POST is valid here.

Note
Currently only allow for Admin (staff) users.
Parameters
requestThe Django HTTP request object
jobIdThe database id of the Job to update
def workspace.tools.views.biasManipulation.stopQueuedChildTasks (   request,
  parentJobId 
)

Set all of a parent Job's queued children to Stopped.

For all children, if status = 'Queued', update status = 'Stopped'.

Parameters
requestThe Django HTTP request object
jobIdThe database id of the parent Job to update
Returns
Django HTTP response object
def workspace.tools.views.biasManipulation.stopQueuedTask (   request,
  jobId 
)

Set a Job to Stopped, only if it is currently Queued.

Parameters
requestThe Django HTTP request object
jobIdThe database id of the Job to update
Returns
Django HTTP response object