Hydrogen: Step-by-step debugging, with breakpoints, step-over/into steps, etc.

Created on 29 Apr 2017  Â·  7Comments  Â·  Source: nteract/hydrogen

Apologies if this is not the right forum for this question. I am wondering if there are any plans for a step-by-step debugger (i.e. with breakpoints, etc), either in Hydrogen or perhaps a recommendation of a different package that would serve this purpose and integrate well with Hydrogen.

I love hydrogen and Atom, but testing MS Visual Code recently got me wondering what we may be missing in our ecosystem (e.g. their debugger looks quite powerful and flexible).

discussion

Most helpful comment

If there are any new developments here, I'm interested as well.

Currently I use a few packages that I wrote (xdbg for python along with hydrogen-xdbg plugin for atom) to debug functions, including across multiple files. They behave a little differently than a standard debugger, but they do achieve a similar effect.

All 7 comments

Hi @amelio-vazquez-reina,
Iam guessing you are working with javascript? I think hydrogen is a different use case to a typical debugger. Have you used atom-node-debugger package in atom? Its quite good.

Hi @alavi09

I'm referring to Python. Almost all my notebooks use functions in modules and packages. I often would like to set up a breakpoint and go step-by-step through the code in these functions to inspect variables and calculations.

E.g.

def some_function_in_my_library(x, y, z, a=something, b=something_else):
   # This function may live in the same file or in a different module that I import
   # I would like to have a breakpoint in this function and go step by step through it
   # ... 
  return result

# %%
# Experimental code
# ...
some_function_in_my_library (val1, val2, val3)
# ...
# %%

This is as good a place as any. There's interest in it within jupyter generally, I don't know what atom's plans are.

/cc @smashwilson :wink: maybe we should chat soon? ¯\_(ツ)_/¯

If there are any new developments here, I'm interested as well.

Currently I use a few packages that I wrote (xdbg for python along with hydrogen-xdbg plugin for atom) to debug functions, including across multiple files. They behave a little differently than a standard debugger, but they do achieve a similar effect.

Any news on this? I am very interested in this too.

Originally @DinoV was working on this over in https://github.com/jupyter/debugger. I'd certainly love to see it advancing, but it likely requires a couple full time engineers doing it as a focused effort and right now no one is working on it.

https://github.com/Microsoft/ptvsd in conjunction with remote debugging (https://code.visualstudio.com/docs/python/debugging#_remote-debugging) looks promising, although I wasn't able to get it to work.

import ptvsd
ptvsd.enable_attach(address=('127.0.0.1', 3000), redirect_output=True)

enables attaching VSCode to a running IPython/Hydrogen process, but breakpoints (in form of breakpoint() or ptvsd.break_into_debugger() call) are getting skipped, as if they weren't there. VSCode even displays live threading information from IPython kernel, so obviously some communication is going on, but IPython refuses to break and yield control.

If I run the same code in a script, everything works just fine. I guess it's some kind of threading issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lgeiger picture lgeiger  Â·  3Comments

neurotronix picture neurotronix  Â·  4Comments

jasonleonhard picture jasonleonhard  Â·  3Comments

ethan92429 picture ethan92429  Â·  3Comments

Mike-MU10 picture Mike-MU10  Â·  4Comments