Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make devs aware of debugging and ipdb in docs #2220

Merged
merged 1 commit into from
Feb 22, 2023
Merged

Make devs aware of debugging and ipdb in docs #2220

merged 1 commit into from
Feb 22, 2023

Conversation

StFroese
Copy link
Member

No description provided.

@StFroese
Copy link
Member Author

discussed in #2149

@kosack
Copy link
Contributor

kosack commented Jan 16, 2023

It would be good to also show how to run a command-line tool in a debugger with and without having to add a breakpoint() line. I think if you add a breakpoint() with an appropriate PYTHONDEBUG set, running e.g. ctapipe-process should work fine. But sometimes you don't want to edit the code, and instead can run the tool directly in debug mode like this:

python -m pdb -m ctapipe.tools.process [usual command-line options]  # for pdb
python -m ipdb -m ctapipe.tools.process [usual command-line options]  # for ipython debugger

ALso the linked article is somewhat out of date, as it recommends using import ipdb; ipdb.set_trace() rather than using the more flexible and modern breakpoint() method introduced in python 3.7, which works for any debugger

@nbiederbeck
Copy link
Contributor

I would also add pytest --pdb in this section

@Tobychev
Copy link
Contributor

I recently found pudb which is a pretty nice if somewhat quirky terminal debugger.

@kosack
Copy link
Contributor

kosack commented Feb 22, 2023

It seem the jobs here are failing, and there is no "restart" button - perhaps push a blank commit and we can just review/merge this?

@maxnoe
Copy link
Member

maxnoe commented Feb 22, 2023

This needs a rebase with main, to e.g. include the fixes for the memory problem (which is I think the issue for the CI failure here).

The reason for the absence of a restart button is probably that github doesn't allow restarting jobs indefinitely.

@maxnoe
Copy link
Member

maxnoe commented Feb 22, 2023

Rebased vs. main now

@maxnoe maxnoe merged commit b9821ba into main Feb 22, 2023
@maxnoe maxnoe deleted the docs_debugging branch February 22, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants