LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
Classes | Functions
pex.config.callStack Namespace Reference

Classes

class  StackFrame
 

Functions

def getCallerFrame (relative=0)
 
def getStackFrame (relative=0)
 
def getCallStack (skip=0)
 

Function Documentation

◆ getCallerFrame()

def pex.config.callStack.getCallerFrame (   relative = 0)
Get the frame for the user's caller.

Parameters
----------
relative : `int`, optional
    Number of frames (0 or more) above the caller to retrieve.
    Default is 0.

Returns
-------
frame : `__builtin__.Frame`
    Frame for the caller.

Notes
-----
This function is excluded from the frame.

Definition at line 34 of file callStack.py.

34 def getCallerFrame(relative=0):
35  """Get the frame for the user's caller.
36 
37  Parameters
38  ----------
39  relative : `int`, optional
40  Number of frames (0 or more) above the caller to retrieve.
41  Default is 0.
42 
43  Returns
44  -------
45  frame : `__builtin__.Frame`
46  Frame for the caller.
47 
48  Notes
49  -----
50  This function is excluded from the frame.
51  """
52  frame = inspect.currentframe().f_back.f_back # Our caller's caller
53  for ii in range(relative):
54  frame = frame.f_back
55  return frame
56 
57 
def getCallerFrame(relative=0)
Definition: callStack.py:34

◆ getCallStack()

def pex.config.callStack.getCallStack (   skip = 0)
Retrieve the call stack for the caller.

Parameters
----------
skip : `int`, non-negative
    Number of stack frames above caller to skip.

Returns
-------
output : `list` of `StackFrame`
    The call stack. The `list` is ordered with the most recent frame to
    last.

Notes
-----
This function is excluded from the call stack.

Definition at line 175 of file callStack.py.

175 def getCallStack(skip=0):
176  """Retrieve the call stack for the caller.
177 
178  Parameters
179  ----------
180  skip : `int`, non-negative
181  Number of stack frames above caller to skip.
182 
183  Returns
184  -------
185  output : `list` of `StackFrame`
186  The call stack. The `list` is ordered with the most recent frame to
187  last.
188 
189  Notes
190  -----
191  This function is excluded from the call stack.
192  """
193  frame = getCallerFrame(skip + 1)
194  stack = []
195  while frame:
196  stack.append(StackFrame.fromFrame(frame))
197  frame = frame.f_back
198  return list(reversed(stack))
199 
def getCallStack(skip=0)
Definition: callStack.py:175
def getCallerFrame(relative=0)
Definition: callStack.py:34
daf::base::PropertyList * list
Definition: fits.cc:903

◆ getStackFrame()

def pex.config.callStack.getStackFrame (   relative = 0)
Get the `StackFrame` for the user's caller.

Parameters
----------
relative : `int`, optional
    Number of frames (0 or more) above the caller to retrieve.

Returns
-------
frame : `StackFrame`
    Stack frame for the caller.

Definition at line 58 of file callStack.py.

58 def getStackFrame(relative=0):
59  """Get the `StackFrame` for the user's caller.
60 
61  Parameters
62  ----------
63  relative : `int`, optional
64  Number of frames (0 or more) above the caller to retrieve.
65 
66  Returns
67  -------
68  frame : `StackFrame`
69  Stack frame for the caller.
70  """
71  frame = getCallerFrame(relative + 1)
72  return StackFrame.fromFrame(frame)
73 
74 
def getStackFrame(relative=0)
Definition: callStack.py:58
def getCallerFrame(relative=0)
Definition: callStack.py:34