How to debug a code block in Pycharm Scientific View - debugging

I have code blocks that begin with # %%.
I would like the debuger to start inside a particular code block and then pause at my breakpoint.
It just runs through the entire script by default.
Thanks

It is not supported at the moment: https://youtrack.jetbrains.com/issue/PY-29672
Perhaps Jupyter notebooks in PyCharm can be a good alternative. They do support independent cell debugging.

Related

Why is Julia's Infiltrator package scrambling my REPL input?

I am using Visual Studio Code with the Julia plugin. Regular debugging is impossibly slow, so I a tried to use the package Infiltrator.jl. I insert #infiltrate where I want execution to stop, just like a breakpoint and then start the REPL. Execution indeed stops there and the REPL prompt changes to yellow infil>. So far so good, but when I type something the letters get scrambled, sometimes when I hit Enter and sometimes even before that. It happens before my eyes. After two or three attempts the REPL prompt changes back to green julia> and the REPL freezes.
Anyone familiar with this problem?
As per the readme:
Running code that ends up triggering the #infiltrate REPL mode via inline evaluation in VSCode or Juno can cause issues, so it's recommended to always use the REPL directly.

Julia .jl in Jupyter notebook

I'm new to Julia, I have a file called "example.jl" and I want to open it in Jupyter. I added the Julia kernel to my jupyter kernels.
My question is:
Is there a terminal command like:
jupyter notebook blabla.ipynb [that I use to open my notebooks]
Which opens my "example.jl" script in my jupyter notebook with the right jl kernel?
I looked into many pages and couldn't find an answer.
P.S: What I do now is to open a notebook with jl kernel and copy the Julia script into it. But I'd like to know if there are more elegant ways to open .jl s.
Generally you need to create a new empty Jupyter notebook with Julia kernel and copy-paste your code there.
There is also a nice Julia implementation - Weave.jl. Since Jupyter's format is more complex, special code formatting is required (for hints see pictures at https://github.com/JunoLab/Weave.jl) - once it is done you can do the conversion in the following way:
convert_doc("examples/some_code.jl", "some_notebook.ipynb")
There are some other (usually Python-based) tools available, that under some circumstances can be used to split source code file into several Jupyter cells but again every time this assumes some specific code formatting.
P.S.
If you are looking for and IDE try Visual Studio Code with Julia extension which is great.

Is there anyway to link iPython notebooks and PyCharm, especially regarding debugging?

iPython notebooks and PyCharm have complementary features, so I'm switching a lot from one to the other. But I would like to make the relationship tighter.
For example, when I'm in a notebook and some code blows up, I would like to set a break point in PyCharm, run my code snippet again, and explore the variables in the breakpoint's scope.
At this point, when I'm in this situation I have to either:
Use the debug command in the notebook, but the navigation within this debugger is a bit clunky (no context autofill, no back-history, no function help display... basically, it seems I'm not in a notebook anymore!)
Go to PyCharm, write a script to recreate the same environment (i.e. imports, variables with their values, etc.) as I was in in the notebook, and launch debug on that script.
This is the main use case I'd like to see solved. Of course, things like triggering PyCharm's "find usages" and "jump to definition" from iPython notebook itself would be a charm (pun not initially intended), but I'll curb my desires for the perfect IDE. For now.
PyCharm 4.0 just came out with iPython integration and allows you to edit *.ipynb files. The official notes are here. Here's how it looks on my screen:

Is there any tools for me to inspect which code is being ran?

I wanna to play around the HP webOS, and doing something system level modification. As you may know that the webOS can inspect the source code, and digging inside the system with something like WebOS doctor with ssh. But I would like to inspect when I doing something, which lines of code is being execute, or.... at least which file is being execute, any ideas on that? Thank you.
You can use the Ares debugger - https://ares.palm.com/Ares/docstemp/debug.html
Or if you are developing in Enyo - you can use the Javascript debugger to set watches and breaks in your code. CTRL+SHIFT+J on a windows machine will bring that up.

Graphical debugger for bash

Is it there any graphical debugger for bash on mac os x or linux? I mean something in the same fashion that the debugging mode of Visual Studio or Eclipse, where one can stop the program hover the mouse pointer over variables and get instantly values, modify them and go backwards and try modifications without the need to start the program fomr the beginning. I am talking about very long bash scripts
for debugging execute your script with:
bash -x <scriptname>
gui debugger:
http://bashdb.sourceforge.net/
Debugger for Bash version 3(Bourne again shell). Plugin for Eclipse. Will only work with shell script editor ShellEd.
http://sourceforge.net/projects/basheclipse/
I have found the vscode-bash-debug
extension (https://github.com/rogalmic/vscode-bash-debug) for the visual studio code editor (https://code.visualstudio.com/) very useful.
I haven't come across a visual debugger, but bashdb works quite well for debugging. You can set breakpoints, continue, print variables etc..
https://sourceforge.net/projects/bashdb/
Install via your distro's repositories. There is a quick-start guide here:
http://www.rodericksmith.plus.com/outlines/manuals/bashdbOutline.html
(first chapter takes only half an hour to read/try).

Resources