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

Create an interactive display for tracebacks in Jupyter #5

Closed
aroberge opened this issue Jul 22, 2021 · 8 comments
Closed

Create an interactive display for tracebacks in Jupyter #5

aroberge opened this issue Jul 22, 2021 · 8 comments
Labels
Future work help welcome Extra attention is needed

Comments

@aroberge
Copy link
Contributor

aroberge commented Jul 22, 2021

In Jupyter notebooks and lab, it might be useful to have a custom iPywidget interactive way to have all the information available in a collapsed form. This would allow to no longer recommend the "controversial" * import.

@psychemedia
Copy link

psychemedia commented Jul 22, 2021

This presumable complements #3 which suggests a simple collapsible heading that states the error message as the heading with the traceback folded beneath it with a more elaborate ipywidget. The ipywidget framework supports two way callbacks between Python and Javascript environments and as such can be used to implement simple applications. What might such widget do / look like?

Perhaps related or useful to help guide thinking about what sorts of interaction or UI are possible are tools such as as nbtutor as well as notebook variable inspectors and debuggers?

@aroberge
Copy link
Contributor Author

What I have in mind is inspired by Thonny's assistant
image

However, the expandable elements would correspond to friendly's what(), where(), why(), as well as the traceback, all headed by the error message. There would be no need of two-way communications: everything would be computed at once and presented in a collapsed state, ready for expansion.

@aroberge
Copy link
Contributor Author

I have implemented something which is not an iPywidget but works essentially as I was hoping it would. Unfortunately, it does not currently work with the dark theme and I cannot figure out why. More explanations can be found on a blog post I just published.

@aroberge aroberge changed the title Create an iPywidget for tracebacks Create an ~~iPywidget~~ interactive display for tracebacks Jul 24, 2021
@aroberge aroberge changed the title Create an ~~iPywidget~~ interactive display for tracebacks Create an interactive display for tracebacks in Jupyter Jul 24, 2021
@aroberge
Copy link
Contributor Author

After reading (again) the documentation about ipywidgets, especially about installing them, I note the following:

Most of the time, installing ipywidgets automatically configures Jupyter ...

Users of friendly are generally not expected to be experienced. Installing friendly should "just work", not simply most of the time, but all the time.

So, I will continue to work on an html-based solution, and should explore how rich deals with jupyter in an attempt to create a more robust solution.

@aroberge
Copy link
Contributor Author

Other than for an extra (annoying) vertical space that I cannot seem to be able to get rid of, I am happy with the result shown on https://twitter.com/andre_roberge/status/1420733729497038848

@psychemedia
Copy link

psychemedia commented Jul 29, 2021

Looks useful:-) My preference would be to reveal the text below, rather than above, the button. With text revealed above, the button moves, with text revealed below the button stays in the same place, (so in the latter case there is less distracting motion).

@aroberge
Copy link
Contributor Author

Ok, I am quite sure I can do this.

@aroberge
Copy link
Contributor Author

Closing this issue as I consider the implementation to be satisfactory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Future work help welcome Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants