LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Classes | Functions
lsst.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 lsst.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 lsst.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))
daf::base::PropertyList * list
Definition: fits.cc:913
def getCallStack(skip=0)
Definition: callStack.py:175

◆ getStackFrame()

def lsst.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