Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork26k
Understanding Cython Code Implementation#29899
-
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).
|
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 3 comments
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I have never done it myself, but I think there are ways to setup a debugger for mixed Python/Cython debugging for example see thisblog post. TheCython 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, seecython/cython#4911. There are also some reports of people managing to do it insideVSCode. 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 🙏. |
BetaWas this translation helpful?Give feedback.
All reactions
-
@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. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
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 |
BetaWas this translation helpful?Give feedback.