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

show_subprocess_widget causes problems outside the notebook #316

Closed
peendebak opened this issue Aug 28, 2016 · 5 comments
Closed

show_subprocess_widget causes problems outside the notebook #316

peendebak opened this issue Aug 28, 2016 · 5 comments

Comments

@peendebak
Copy link
Contributor

The show_subprocess_widget causes problems with systems not using ipython notebook (command line, spyder). A first approach to solving is was made in PR #278, but no definite conclusion was reached on how to solve it. There are a few options:

  • Merge add simple config system #308 (or some other config system) and then make all code loading the ipython widgets optional (with the default option: load the widgets, so there is no difference with current behaviour)
  • Do not load widgets at all by default. This means users have to specifically load the widgets
  • Use the PR do not load notebook elements when no notebook is running #278 (with some polishing). In this PR a function frontend() is introduced that determined whether the widgets are loaded or not. The function itself check an environment variable to determine whether we are in notebook mode or not
  • Remove the show_subprocess_widget entirely

@giulioungaretti @alexcjohnson

@giulioungaretti
Copy link
Contributor

@peendebak more information on the problems you get would be really helpful ! My best guess is that really your troubles are from the stream_queue that captures the stdout/stderr .

@eendebakpt
Copy link
Contributor

@giulioungaretti With command line my scripts hang, with spyder is have random crashes. I don't think more information is needed: there is no reason why notebook functions should be executed when there is no notebook running.

@CJvanDiepen
Copy link
Contributor

@giulioungaretti The crash is reproducible now. When I start an instrument on the server the module qcodes.plots.base is loaded, which has

from IPython.display import display
from qcodes.widgets.widgets import HiddenUpdateWidget

The loading of display generates an error:

 [12:45:15.071 testv160_model ERR]   File "d:\software\Anaconda\envs\eendebakpt\lib\site-packages\IPython\terminal\interactiveshell.py", line 77, in <module>
    _is_tty = (sys.stdin.isatty()) and (sys.stdout.isatty()) and  (sys.stderr.isatty())

The only proper fix for this is to make loading the ipython widgets optional.

@peendebak peendebak mentioned this issue Aug 31, 2016
@giulioungaretti
Copy link
Contributor

Which means breaking plotting as far as I know it's implement with a javacrpit/python widgets that a calls periodically an update function.

@peendebak
Copy link
Contributor Author

@giulioungaretti Qt plotting works fine without these widgets (also see #290). Matplotlib plotting I have not checked. The loading of ipython widgets is optional and on by default so this will not break anything for normal notebook users.

For users not using ipython notebook the current code does not work, so there should be some method to prevent loading these widgets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants