[IPython-User] Use %debug to check variable value before last traceback error?
Chao YUE
chaoyuejoy@gmail....
Thu Aug 2 02:59:40 CDT 2012
Dear all,
suppose I have an error traceback within in interactive session like the
following, if I use %debug, I will go to the environment of last traceback
error.
Is it possible that I can choose to go one of the 5 errors (let's say I
want to check the error environment of the second one which error occurs on
line 19 for example)?
thanks in advance,
Chao
In [25]: %run -i popd_ign_suppress_Kloster.py
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/usr/local/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in
execfile(fname, *where)
173 else:
174 filename = fname
--> 175 __builtin__.execfile(filename, *where)
/mnt/f/fire_north_boreal_forest/model_understanding_validation/popd_ign_suppress_Kloster.py
in <module>()
17
18 for i,popd_i in enumerate(popd):
---> 19 ign[i]=calc_ign(popd_i)
20 supp[i]=calc_supp(popd_i)
21 supp_ign[i]=ign[i]*supp[i]
/mnt/f/fire_north_boreal_forest/model_understanding_validation/popd_ign_suppress_Kloster.py
in calc_ign(popd)
6 def calc_ign(popd):
7 fire_danger=6.8*(popd**(-0.57))
----> 8 return np.min(1.,popd*fire_danger/(300.*6.8*(300**(-0.57))))
9
10 def calc_supp(popd):
/usr/local/lib/python2.7/dist-packages/numpy/core/fromnumeric.pyc in
amin(a, axis, out)
1892 amin = a.min
1893 except AttributeError:
-> 1894 return _wrapit(a, 'min', axis, out)
1895 return amin(axis, out)
1896
/usr/local/lib/python2.7/dist-packages/numpy/core/fromnumeric.pyc in
_wrapit(obj, method, *args, **kwds)
35 except AttributeError:
36 wrap = None
---> 37 result = getattr(asarray(obj),method)(*args, **kwds)
38 if wrap:
39 if not isinstance(result, mu.ndarray):
ValueError: axis(=1) out of bounds
--
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120802/d2967c66/attachment.html
More information about the IPython-User
mailing list