Understanding Cython Code Implementation #29899
Replies: 3 comments
-
I have never done it myself, but I think there are ways to setup a debugger for mixed Python/Cython debugging for example see this blog post. The Cython documentation may have some useful info although part of it is out-of-date for example the part where it says Python 2 is needed, see cython/cython#4911. There are also some reports of people managing to do it inside VSCode. If you manage to do it, I think it would be great if you post how to do it because I am guessing this would be useful for others 🙏. |
Beta Was this translation helpful? Give feedback.
-
@lesteve thanks for your response. I will try out these. (On a high level it looks we need to run the py debugger and the gdg (or cygdb) independently). But since you have mentioned that you haven't tried or did this, I will keep this thread open. |
Beta Was this translation helpful? Give feedback.
-
I am in a similar boat debugging the K-D trees function calls from my user program. Unfortunately I did not get very far with PDB, all I saw was a step into a utility file and a function named checkarray. I also had no idea what was Cython and/or Python code |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have started going through the codebase for Random Forest Implementation (RandomForestClassifier). I usually use the debugger in py files, add the breakpoints, and go through line by line printing the variables simultaneously to understand the code logic and code flow. Since the core logic part is written in Cython, The code (running Random Forest Classifier from a .py file) is unable to step into the Cython code. The only option that I have is to manually go through the Cython code (without debugger) or use print() statements which will be lengthier. I want help with two things (Any additional pointers are also welcome).
Beta Was this translation helpful? Give feedback.
All reactions