Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for...
Transcript of Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for...
![Page 1: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/1.jpg)
Visual Debugger for Jupyter Notebooks:
Myth or Reality?Elizaveta Shashkova
EuroPython 2019
![Page 2: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/2.jpg)
About Me
•Software Developer at JetBrains, PyCharm IDE
•Debugger and Data Science tools
• @lisa_shashkova
�2
![Page 3: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/3.jpg)
Visual Debugger
�3
![Page 4: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/4.jpg)
Jupyter Notebooks
•Popular scientific tool
• File is a sequence of cells
�4
![Page 5: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/5.jpg)
Jupyter Notebooks Debug
�5
•Logging with print statements
•Command-line debugger ipdb
![Page 6: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/6.jpg)
Jupyter Notebooks Debug
�6
![Page 7: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/7.jpg)
Myth or Reality?
![Page 8: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/8.jpg)
Myth or Reality?
![Page 9: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/9.jpg)
Contents
•Python files debugging
• Jupyter breakpoints
•Debugger communication
• Jupyter visual debugger
�9
![Page 10: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/10.jpg)
Tracing Function
�10
def tracefunc(frame, event, arg): print(frame.f_lineno, event) return tracefunc
sys.settrace(tracefunc)
1 2 3 4 5 6
![Page 11: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/11.jpg)
Tracing Function
�11
def greet_neighbors(): planets = ["Mars", "Venus"] for p in planets: print(f"Hi {p}!") return len(planets)
sys.settrace(tracefunc) greet_neighbors()
1 2 3 4 5 6 7 8 9
![Page 12: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/12.jpg)
Tracing Function
�12
1 2 3 4 5 6 7 8 9
1 call def greet_neighbors(): planets = ["Mars", "Venus"] for p in planets: print(f"Hi {p}!") return len(planets)
sys.settrace(tracefunc) greet_neighbors()
![Page 13: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/13.jpg)
Tracing Function
�13
1 2 3 4 5 6 7 8 9
1 call 2 line
def greet_neighbors(): planets = ["Mars", "Venus"] for p in planets: print(f"Hi {p}!") return len(planets)
sys.settrace(tracefunc) greet_neighbors()
![Page 14: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/14.jpg)
Tracing Function
�14
1 2 3 4 5 6 7 8 9
1 call 2 line 3 line 4 line Hi Mars!
def greet_neighbors(): planets = ["Mars", "Venus"] for p in planets: print(f"Hi {p}!") return len(planets)
sys.settrace(tracefunc) greet_neighbors()
![Page 15: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/15.jpg)
Tracing Function
�15
1 2 3 4 5 6 7 8 9
1 call 2 line 3 line 4 line Hi Mars! 3 line 4 line Hi Venus!
def greet_neighbors(): planets = ["Mars", "Venus"] for p in planets: print(f"Hi {p}!") return len(planets)
sys.settrace(tracefunc) greet_neighbors()
![Page 16: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/16.jpg)
Tracing Function
�16
1 2 3 4 5 6 7 8 9
def greet_neighbors(): planets = ["Mars", "Venus"] for p in planets: print(f"Hi {p}!") return len(planets)
sys.settrace(tracefunc) greet_neighbors()
1 call 2 line 3 line 4 line Hi Mars! 3 line 4 line Hi Venus! 5 line 5 return
![Page 17: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/17.jpg)
Breakpoint
•frame.f_lineno - current line number
•frame.f_code.co_filename - current file name
�17
![Page 18: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/18.jpg)
Breakpoint
•frame.f_lineno - current line number
•frame.f_code.co_filename - current file name
•Equals to breakpoint’s file and line -> suspend program!
�18
![Page 19: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/19.jpg)
Contents
•Python files debugging
• Jupyter breakpoints
•Debugger communication
• Jupyter visual debugger
�19
![Page 20: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/20.jpg)
Contents
•Python files debugging
• Jupyter breakpoints
•Debugger communication
• Jupyter visual debugger
�20
![Page 21: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/21.jpg)
Cells Execution
�21
IPython kernel
Front-end
IDE
![Page 22: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/22.jpg)
Cells Execution
�22
code IPython kernel
Front-end
IDE
![Page 23: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/23.jpg)
IPython kernel
Cells Execution
�23
code executionFront-end
IDE
![Page 24: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/24.jpg)
Cells Execution
�24
result
IPython kernel
Front-end
IDE
![Page 25: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/25.jpg)
Cells Execution
•Kernel generates a unique name for each cell
• <ipython-input-5-11faed10a894>
•File name of a generated code object
�25
IPython kernel
code execution
![Page 26: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/26.jpg)
Jupyter Breakpoints
•Python files: (filename, line number) -> unique location
�26
![Page 27: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/27.jpg)
Jupyter Breakpoints
•Python files: (filename, line number) -> unique location
• Jupyter Notebooks?
�27
![Page 28: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/28.jpg)
Jupyter Breakpoints
•Python files: (filename, line number) -> unique location
• Jupyter Notebooks:
•generated cell name
• line inside code object
�28
![Page 29: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/29.jpg)
Source Mapping
�29
IPython kernelIDE
cell source codeMyNotebook.ipynb
generated <code object>
![Page 30: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/30.jpg)
Source Mapping
�30
IPython kernelIDE
cell source codeMyNotebook.ipynb
cell idgenerated
<code object>
![Page 31: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/31.jpg)
IPython kernelIDE
Source Mapping
�31
?
cell source codeMyNotebook.ipynb
cell idgenerated
<code object>
![Page 32: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/32.jpg)
Source Mapping
�32
•Tracking cells execution in the IDE
![Page 33: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/33.jpg)
Source Mapping
�33
•Tracking cells execution in the IDE
•Silent cell execution in IPython kernel
![Page 34: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/34.jpg)
Debug Cell Execution
�34
<cell source code>
![Page 35: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/35.jpg)
Debug Cell Execution
�35
<cell source code>
patch name generation
- silent mode
![Page 36: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/36.jpg)
Debug Cell Execution
�36
<cell source code>
patch name generation
cell id
- silent mode
![Page 37: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/37.jpg)
Jupyter Tracing Function
•frame.f_code.co_filename - generated name
�37
![Page 38: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/38.jpg)
Jupyter Tracing Function
•frame.f_code.co_filename - generated name
•Map: generated name -> cell id
�38
![Page 39: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/39.jpg)
Jupyter Tracing Function
•frame.f_code.co_filename - generated name
•Map: generated name -> cell id
• Send message to the IDE
�39
![Page 40: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/40.jpg)
Jupyter Tracing Function
•frame.f_code.co_filename - generated name
•Map: generated name -> cell id
• Send message to the IDE
�40
![Page 41: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/41.jpg)
Contents
•Python files debugging
• Jupyter breakpoints
•Debugger communication
• Jupyter visual debugger
�41
![Page 42: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/42.jpg)
Contents
•Python files debugging
• Jupyter breakpoints
•Debugger communication
• Jupyter visual debugger
�42
![Page 43: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/43.jpg)
Debug Communication
�43
“Add breakpoint in a cell 3, line 2”
IPython kernel
Front-end
IDE
![Page 44: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/44.jpg)
Debug Communication
�44
“Add breakpoint in a cell 3, line 2”
IPython kernel
Front-end
IDE
![Page 45: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/45.jpg)
Debug Communication
�45
•Additional connection
•Reuse Jupyter channels
![Page 46: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/46.jpg)
Jupyter Messaging
�46
Front-end
IPython kernelKernel proxy
![Page 47: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/47.jpg)
Jupyter Messaging
�47
Front-end
IPython kernelKernel proxy
![Page 48: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/48.jpg)
Debug Communication
�48
•Additional connection
•Reuse Jupyter channels
![Page 49: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/49.jpg)
Debug Communication
�49
•Additional connection
•Reuse Jupyter channels
![Page 50: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/50.jpg)
Jupyter Messaging
�50
Front-endKernel proxy
IPython kernelShell
IOPub
stdin
![Page 51: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/51.jpg)
Jupyter Architecture
�51
•Event loop in a main thread for execution events
•Event loop for output events
![Page 52: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/52.jpg)
Jupyter Architecture
�52
code
debug
x Blocked
IPython kernel
Front-end
IDE
![Page 53: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/53.jpg)
Debug Communication
�53
•Additional connection
•Reuse Jupyter channels
![Page 54: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/54.jpg)
Debug Communication
�54
•Additional connection
•Reuse Jupyter channels
But ipdb works!
![Page 55: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/55.jpg)
But ipdb Works!
�55
![Page 56: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/56.jpg)
But ipdb Works!
�56
•Based on input()
•Reuses user input channel
![Page 57: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/57.jpg)
Debug Communication
�57
•Additional connection
•Reuse Jupyter channels
![Page 58: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/58.jpg)
Contents
•Python files debugging
• Jupyter breakpoints
•Debugger communication
• Jupyter visual debugger
�58
![Page 59: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/59.jpg)
Contents
•Python files debugging
• Jupyter breakpoints
•Debugger communication
• Jupyter visual debugger
�59
![Page 60: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/60.jpg)
Jupyter Visual Debugger
• Jupyter tracing function
�60
![Page 61: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/61.jpg)
Jupyter Visual Debugger
• Jupyter tracing function
•Mapping between editor and generated code
�61
![Page 62: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/62.jpg)
Jupyter Visual Debugger
• Jupyter tracing function
•Mapping between editor and generated code
•Debugger connection
�62
![Page 63: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/63.jpg)
Live Demo
�63
![Page 64: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/64.jpg)
Live Demo
�64
•PyCharm doesn’t convert Jupyter Notebooks to Python files!
•On disk it’s still the same JSON file with .ipynb extension
![Page 65: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/65.jpg)
Jupyter Visual Debugger
• Jupyter tracing function
•Mapping between editor and generated code
•Debugger connection
�65
![Page 66: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/66.jpg)
Jupyter Visual Debugger
•Implement in your favourite IDE
�66
![Page 67: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/67.jpg)
Jupyter Visual Debugger
•Implement in your favourite IDE
•Try it in PyCharm Pro!
�67
![Page 68: Visual Debugger for Jupyter Notebooks: Myth or Reality? · 2019-07-10 · Visual Debugger for Jupyter Notebooks: Myth or Reality? Elizaveta Shashkova ... •Python files debugging](https://reader033.fdocuments.in/reader033/viewer/2022052721/5f0b42ea7e708231d42fa45f/html5/thumbnails/68.jpg)
Jupyter Visual Debugger
•Implement in your favourite IDE
•Try it in PyCharm Pro!
•Questions?
�68
@lisa_shashkova