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

Subprocess widget #13

Merged
merged 12 commits into from
Jan 27, 2016
Merged

Subprocess widget #13

merged 12 commits into from
Jan 27, 2016

Conversation

alexcjohnson
Copy link
Contributor

@akhmerov re: qdev-dk-archive#10 (comment) - output appearing in the notebook server terminal... here I'm collecting it in a console that lives in the corner of the screen, shows what subprocesses are running and allows you to abort measurement loops.

@AdriaanRol @guenp look reasonable?

subprocess widget

@guenp
Copy link
Contributor

guenp commented Jan 26, 2016

That looks pretty cool!
Is this saved in a log file, as well?

On 26 Jan 2016, at 11:16, alexcjohnson <notifications@github.commailto:notifications@github.com> wrote:

@akhmerovhttps://github.com/akhmerov re: #10 (comment)qdev-dk-archive#10 (comment) - output appearing in the notebook server terminal... here I'm collecting it in a console that lives in the corner of the screen, shows what subprocesses are running and allows you to abort measurement loops.

@AdriaanRolhttps://github.com/AdriaanRol @guenphttps://github.com/guenp look reasonable?

[subprocess widget]https://cloud.githubusercontent.com/assets/2678795/12586402/686b211e-c450-11e5-9d0a-e1d6f91217d1.png


You can view, comment on, or merge this pull request online at:

qdev-dk-archive#13

Commit Summary

  • break multiprocessing functions out of utils.helpers
  • StreamQueue
  • integrate StreamQueue into PrintableProcess to make QcodesProcess
  • test QcodesProcess and StreamQueue
  • Merge branch 'master' into collect-messages
  • StreamQueue knows if it's being watched
  • SubprocessOutputWidget
  • fix bugs in get_bg and halt_bg
  • show subprocess state and abort button in subprocess widget
  • display belongs in widgets

File Changes

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com/qdev-dk-archive/pull/13.

@alexcjohnson
Copy link
Contributor Author

@guenp

Is this saved in a log file, as well?

No, but that's a great idea! Talking with folks here today about adopting qcodes, it came up that we should also log all the code cells that are run, in case users overwrite a cell or call a cell multiple times. Do you think it makes sense to put these together in one file?

@akhmerov
Copy link
Contributor

@alexcjohnson

Way better than the server terminal!

Why not regular ipywidgets for this? They can be floated (cf the variable inspector widget example). Also with the introduction of Jupyter Lab, there will be further UI tools for dashboard-style applications, did you hear about that activity?

we should also log all the code cells that are run, in case users overwrite a cell or call a cell multiple times

I find this tricky, because a notebook may quite easily be used also for non-Qcodes things. Preferably only the Qcodes calls would be logged by Qcodes, and in that case, the cells themselves aren't relevant.

Logs with all cells are already relatively hard to parse by a human, since it has to be done by hand, even more so if also mixed with process status warnings.

Also a bonus question: while I'm a huge jupyter fan, what happens with these warnings if the user runs a .py script using Qcodes: do they just show up in stderr (just checking)?

@guenp
Copy link
Contributor

guenp commented Jan 26, 2016

Yeah sounds good, if it's readable enough :)

Guenevere Prawiroatmodjo
PhD candidate
Center for Quantum Devices
Niels Bohr Institute
guen@nbi.dkmailto:guen@nbi.dk

On 26 jan. 2016, at 16:26, alexcjohnson <notifications@github.commailto:notifications@github.com> wrote:

@guenphttps://github.com/guenp

Is this saved in a log file, as well?

No, but that's a great idea! Talking with folks here today about adopting qcodes, it came up that we should also log all the code cells that are run, in case users overwrite a cell or call a cell multiple times. Do you think it makes sense to put these together in one file?


Reply to this email directly or view it on GitHubhttps://github.com/qdev-dk-archive/pull/13#issuecomment-175237445.

@alexcjohnson
Copy link
Contributor Author

@akhmerov

Why not regular ipywidgets for this?

Isn't it? I subclassed my own subclass of widgets.DOMwidget for this.

They can be floated

I played with that a bit but didn't like it as much for the default, but that would be an easy option to add, good point.

Jupyter Lab

Haven't heard and not seeing it in a quick search, can you point me to it?

Preferably only the Qcodes calls would be logged by Qcodes

This console will only show up if you ask for it and we could certainly make logging optional - like if you want the console to watch analysis or monitoring subprocesses (though those subprocesses have to inherit from QcodesProcess rather than just multiprocessing.Process to hook into this redirection). But moreover, I think if you are logging, you want to log everything. There may well be hardware calls or other interesting code called that's not directly part of Qcodes.

Also a bonus question: while I'm a huge jupyter fan, what happens with these warnings if the user runs a .py script using Qcodes: do they just show up in stderr (just checking)?

Correct. If you're not in a notebook the standard top-level import of this routine won't even exist. In that case, or if you don't show the console, or if it goes away, then it won't be watching the associated queue. And if nobody is watching the queue for more than a few seconds it starts spitting everything to stdout (in addition to the queue) - but maybe you're right that stderr would be better. Though, now that you mention it, the few second delay could be ruinous in some cases - I suppose I could call that same test for whether you're in a notebook before starting the QcodesProcess, so only processes started from a notebook get this redirection...

@akhmerov
Copy link
Contributor

@alexcjohnson thanks for the clarification, I agree with everything (also sorry I didn't notice the inheritance from DOMWidget).

JupyterLab is the codeword for the new plugin-based web UI they are developing (see roadmap. It will allow to design jupyter-powered custom applications (spreadsheet is one example the devs always bring up), and notebook would be one out of many.

@alexcjohnson
Copy link
Contributor Author

I'm going to add logging in another PR because it has a few more issues to sort out first.

alexcjohnson added a commit that referenced this pull request Jan 27, 2016
@alexcjohnson alexcjohnson merged commit 8c0692e into master Jan 27, 2016
@alexcjohnson alexcjohnson deleted the collect-messages branch January 27, 2016 15:40
giulioungaretti added a commit that referenced this pull request Mar 29, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Mar 30, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Mar 30, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Apr 3, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Apr 10, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes May 2, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Jun 1, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Jun 22, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Jun 27, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Jul 7, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Jul 18, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 3, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 3, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 7, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 9, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 10, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 16, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 18, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 22, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Sep 21, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
nataliejpg pushed a commit to nataliejpg/Qcodes that referenced this pull request Oct 11, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Oct 27, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Nov 21, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Nov 23, 2017
* feat: Add station to init

Add a station to init and make a device image if it does not exist.

Breaking changes: init now requires a station

* fix: Don't save ann. img. in main folder

Save annotated device images in the data subfolders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants