ATLAS Offline Software
Classes | Functions
python.DebuggingContext Namespace Reference

Classes

class  Context
 

Functions

def shortCallStack ()
 
def createContextForDeduplication (message, compName, destContext)
 
def raiseWithCurrentContext (exception)
 

Function Documentation

◆ createContextForDeduplication()

def python.DebuggingContext.createContextForDeduplication (   message,
  compName,
  destContext 
)

Definition at line 40 of file DebuggingContext.py.

40 def createContextForDeduplication(message, compName, destContext):
41  return Context(f"{message} : {compName} : {destContext.get(compName, Context.hint)}")
42 
43 

◆ raiseWithCurrentContext()

def python.DebuggingContext.raiseWithCurrentContext (   exception)
Raises the exception with the message supplemented with context information

Definition at line 44 of file DebuggingContext.py.

44 def raiseWithCurrentContext(exception):
45  """
46  Raises the exception with the message supplemented with context information
47  """
48  raise type(exception)(str(exception) + '\nWith the context:\n{}'.format(Context.complete()) )

◆ shortCallStack()

def python.DebuggingContext.shortCallStack ( )
Obtains (a very abbreviated) context of the current call stack (from the top, excluding the code using this function)

Definition at line 29 of file DebuggingContext.py.

29 def shortCallStack():
30  """
31  Obtains (a very abbreviated) context of the current call stack (from the top, excluding the code using this function)
32  """
33  import inspect
34  compact = ' >>> '
35  for frameInfo in inspect.stack()[2:][::-1]:
36  compact += "{}:{}({}) ".format(frameInfo.filename.split('/')[-1], frameInfo.frame.f_lineno, frameInfo.function)
37  return compact
38 
39 
python.DebuggingContext.raiseWithCurrentContext
def raiseWithCurrentContext(exception)
Definition: DebuggingContext.py:44
vtune_athena.format
format
Definition: vtune_athena.py:14
python.DebuggingContext.createContextForDeduplication
def createContextForDeduplication(message, compName, destContext)
Definition: DebuggingContext.py:40
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
str
Definition: BTagTrackIpAccessor.cxx:11
python.DebuggingContext.shortCallStack
def shortCallStack()
Definition: DebuggingContext.py:29