question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Version 0.5.0+ no longer displays output after widget interaction

See original GitHub issue

I have not labeled this as a “bug report” as I am not sure whether this is a new feature or regression.

I am developing a package for the processing of NMR spectra that makes extensive use of the ipympl backend: https://github.com/NMRPy/nmrpy

As part of this there are a number of widgets (interactive matplotlib graphs) for phasing and peak picking of the NMR spectra. Some of these widgets print output to the cell output area (below the ipympl widget) after user interaction, using simple print() function calls in the code. In some cases further user input is required for which I have made use of an ipywidgets.FloatText() which is then also displayed in the output area.

As of version 0.5.0 this cell output area is no longer displayed. The widget interaction with the ipympl graphs still works but the text output from print() calls and the ipywidgets output are not there.

  • Is this intentional or a regression?
  • If intentional, is there a way to get the output area back, or an alternative where to direct text output after interaction with a graph (or instantiate an ipywidgets widget) so that it is displayed to the user?

This functionality is crucial to my application and currently I am thus stuck with using ipympl<0.5.0. BTW this is using notebook, not jupyterlab.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
thomasaarholtcommented, Jun 11, 2020

Can confirm. In the old ipympl (0.4.x) version the text appears, in the new version it does not. ipywidgets version is the same (7.5.1) in both cases.

I think ipympl is mature enough to justify spending some time on proper documentation (I’ve said I’d do that before, let’s see what I can manage this weekend). But I guess the current issue is about release notes, which is particularly justified since the API (or equivalent to that) is changing with new releases.

2reactions
thomasaarholtcommented, Jun 11, 2020

I’m not 100% sure if I’ve understood this correct, but I believe what you’re experiencing is how unless you create a widgets.Output, then use your print function with that Output, and make sure to display() that Output widget, the output won’t be created.

I’ve quickly made an example below, and you can read more in the docs here. It is definitely confusing at first, but quite flexible!

button = ipywidgets.Button(description='Hello there')

output = ipywidgets.Output()

def print_hello(*args):
    print('Does not work')
    with output:
        print('Does work')
button.on_click(print_hello)
display(ipywidgets.HBox([button, output]))

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

JuliaLang/Interact.jl - Gitter
While I can import it ok, it crashes as soon as I try to create a widget. ... Interact.jl seems to be broken...
Read more >
Usage — nbsphinx version 0.5.0 - Read the Docs
Answer the questions that appear on the screen. In case of doubt, just press the <Return> key repeatedly to take the default values....
Read more >
FigureWidget doesn't print graph - Plotly Community Forum
Hi All, I have been using plotly for a while and it worked great until i had to use FigureWidget to interact with...
Read more >
Jupyter Notebook: interactive plot with widgets - Stack Overflow
(I am using Python 2.7, matplotlib 2.0 and I have just updated notebook and jupyter to the latest version. let me know if...
Read more >
Widget to Blueprint communication in UE4 (Not limited to VR)
UnrealEngine #VR #Blueprints▻ DescriptionHey everyone, in this video I show you how you can make a 3D widget and have it communicate with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found