ATLAS Offline Software
Loading...
Searching...
No Matches
python.trfUtils.Job Class Reference

Job: a set of pieces of information relevant to a given work function. More...

Inheritance diagram for python.trfUtils.Job:
Collaboration diagram for python.trfUtils.Job:

Public Member Functions

 __init__ (self, workFunction=None, workFunctionKeywordArguments={}, workFunctionTimeout=None, name=None)
 initialisation method
 name (self)
 __str__ (self)
 return an object self description string
 printout (self)
 print in a human-readable way the items of the object self

Public Attributes

 workFunction = workFunction
 workFunctionKeywordArguments = workFunctionKeywordArguments
 workFunctionTimeout = workFunctionTimeout
 className = self.__class__.__name__
 resultGetter = None

Protected Attributes

 _name = uniqueIdentifier()

Detailed Description

Job: a set of pieces of information relevant to a given work function.

A Job object is a set of pieces of information relevant to a given work function. A Job object comprises a name, a work function, work function arguments, the work function timeout specification, a multiprocessing.pool.ApplyResult (AsyncResult alias thereof) object and, ultimately, a result object.

Parameters
namethe Job object name
workFunctionthe work function object
workFunctionArgumentsthe work function keyword arguments dictionary
workFunctionTimeoutthe work function timeout specification in seconds

Definition at line 725 of file trfUtils.py.

Constructor & Destructor Documentation

◆ __init__()

python.trfUtils.Job.__init__ ( self,
workFunction = None,
workFunctionKeywordArguments = {},
workFunctionTimeout = None,
name = None )

initialisation method

Definition at line 728 of file trfUtils.py.

734 ):
735 self.workFunction = workFunction
736 self.workFunctionKeywordArguments = workFunctionKeywordArguments
737 self.workFunctionTimeout = workFunctionTimeout
738 self.className = self.__class__.__name__
739 self.resultGetter = None
740 if name is None:
741 self._name = uniqueIdentifier()
742 else:
743 self._name = name
744 if self.workFunction is None:
745 exceptionMessage = "work function not specified"
746 msg.error("{notifier}: exception message: {exceptionMessage}".format(
747 notifier = self.className,
748 exceptionMessage = exceptionMessage
749 ))
750 raise trfExceptions.TransformInternalException(
751 trfExit.nameToCode('TRF_INTERNAL'),
752 exceptionMessage
753 )
754

Member Function Documentation

◆ __str__()

python.trfUtils.Job.__str__ ( self)

return an object self description string

This method returns an object description string consisting of a listing of the items of the object self.

Returns
object description string

Definition at line 763 of file trfUtils.py.

763 def __str__(self):
764 descriptionString = ""
765 for key, value in sorted(vars(self).items()):
766 descriptionString += str("{key}:{value} ".format(
767 key = key,
768 value = value)
769 )
770 return descriptionString
771

◆ name()

python.trfUtils.Job.name ( self)

Definition at line 756 of file trfUtils.py.

756 def name(self):
757 return self._name
758

◆ printout()

python.trfUtils.Job.printout ( self)

print in a human-readable way the items of the object self

This function prints in a human-readable way the items of the object self.

Definition at line 775 of file trfUtils.py.

775 def printout(self):
776 printHR(vars(self))
777
778

Member Data Documentation

◆ _name

python.trfUtils.Job._name = uniqueIdentifier()
protected

Definition at line 741 of file trfUtils.py.

◆ className

python.trfUtils.Job.className = self.__class__.__name__

Definition at line 738 of file trfUtils.py.

◆ resultGetter

python.trfUtils.Job.resultGetter = None

Definition at line 739 of file trfUtils.py.

◆ workFunction

python.trfUtils.Job.workFunction = workFunction

Definition at line 735 of file trfUtils.py.

◆ workFunctionKeywordArguments

python.trfUtils.Job.workFunctionKeywordArguments = workFunctionKeywordArguments

Definition at line 736 of file trfUtils.py.

◆ workFunctionTimeout

python.trfUtils.Job.workFunctionTimeout = workFunctionTimeout

Definition at line 737 of file trfUtils.py.


The documentation for this class was generated from the following file: