Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New tutorial section: debugging with IPython #14347

Open
astrojuanlu opened this issue Feb 19, 2024 · 4 comments
Open

New tutorial section: debugging with IPython #14347

astrojuanlu opened this issue Feb 19, 2024 · 4 comments

Comments

@astrojuanlu
Copy link
Contributor

My colleague @lrcouto did some extensive research on debugging techniques for IPython and for now we've added those to the Kedro docs, but we wanted to ask if you'd accept a PR with a new section under "Tutorial" called "How to debug with IPython". Could include:

  • %debug for interactive debugging
  • %pdb for postmortem debugging
  • %run for running specific files
  • Some cool GIFs
  • An (i)pdb cheatsheet:
Command Description
list Show the current location in the file
h(elp) Show a list of commands, or find help on a specific command
q(uit) Quit the debugger and the program
c(ontinue) Quit the debugger, continue in the program
n(ext) Go to the next step of the program
<enter> Repeat the previous command
p(rint) Print variables
s(tep) Step into a subroutine
r(eturn) Return out of a subroutine
b(reak) Insert a breakpoint
a(rgs) Print the argument list of the current function
@astrojuanlu astrojuanlu changed the title New tutorial: debugging with IPython New tutorial section: debugging with IPython Feb 19, 2024
@ccordoba12
Copy link
Member

This is a really good idea! We could point to it from the Spyder docs too.

%debug for interactive debugging
%pdb for postmortem debugging

If I'm not mistaken, you can also use %debug for interactive, postmortem debugging.

@astrojuanlu
Copy link
Contributor Author

I stand corrected, thanks Carlos!

@ivanov
Copy link
Member

ivanov commented Feb 23, 2024

This sounds great, @astrojuanlu ! Thrown in u(p) and d(own) for navigating a postmortem stack, and ! for executing arbitrary python code, which for some reason in not in help (like !1+1), and you've got yourself a deal!

@ivanov
Copy link
Member

ivanov commented Feb 23, 2024

I guess there might be a concern with the size of the gifs, so I guess we would want to be mindful of not blowing up the size of this repo, also since those wouldn't work in PDF output of the docs, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants