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

Use same window for autoplotting #240

Open
nulinspiratie opened this issue Dec 1, 2021 · 4 comments
Open

Use same window for autoplotting #240

nulinspiratie opened this issue Dec 1, 2021 · 4 comments
Assignees
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@nulinspiratie
Copy link

nulinspiratie commented Dec 1, 2021

I've found the "Auto-plot new" feature of Plottr quite useful because it allows me to always view the currently active measurement.
However, it is currently programmed such that every new measurement opens a new window, and also doesn't close the previous window. This can create an excessive amount of windows, especially when executing several measurements in quick succession.

I propose the option to have a dedicated window for auto-plotting. Whenever a new measurement is started, it will clear contents of that window, and replace it with the contents of the new dataset. It could for example be enabled by a second checkbox as such:
Screenshot 2021-12-01 140618
Edit: It looks like uploading an image doesn't work. The example showed a second checkbox with text "Same window" below the "Auto-plot new" checkbox

I wanted to see how others feel about this, and if others agree it would be a good addition, what a good strategy is to implement this.
Looking over the code, I think the best strategy would be to have an attribute QCodesDBInspector._autoplot_window which could point towards a dedicated autoplot window. Further, AutoPlotMainWindow should have a method to clear it's contents and to load new contents.

@astafan8
Copy link
Collaborator

astafan8 commented Dec 1, 2021

Sound useful to me :) i think it's worth creating a PR with the implementation

Looking over the code, I think the best strategy would be to have an attribute QCodesDBInspector._autoplot_window which could point towards a dedicated autoplot window. Further, AutoPlotMainWindow should have a method to clear it's contents and to load new contents.

sounds correct to me. i think it will be more obvious with a PR opened, also other maintainers/reviewers can chip in

@wpfff
Copy link
Contributor

wpfff commented Dec 1, 2021

This is an excellent suggestion!
I've been thinking about this as well for the live plotting functionality. I like the idea of having a dedicated live plot window, but still be able to open others manually on demand.

As a note on that:
I would maybe want to propose to have a single mechanism for managing autoplot windows that works similarly for both inspectr and monitr.
The way the two handle things is not quite the same at the moment. See: https://github.com/toolsforexperiments/plottr/blob/master/plottr/apps/monitr.py

there i've recently implemented running each autoplot window in a dedicated process (which makes things a lot faster/more responsive for us).

Me and one of my students are starting to do some work on monitr, and we could include work on this feature with that. I will likely have some time after the semester ends (in about a week) to put some work into this.

@nulinspiratie
Copy link
Author

Glad to hear this feature could be an addition to Plottr! If there is a part of this that I can help out with please let me know.

@wpfff I hadn't yet noticed that inspectr and monitr were two different classes. Is monitr continuously checking for new/updated datasets, and it then refreshes plottr and optionally auto-plots the new data sets?

@wpfff wpfff self-assigned this Dec 6, 2021
@wpfff wpfff added the enhancement New feature or request label Dec 6, 2021
@wpfff
Copy link
Contributor

wpfff commented Dec 6, 2021

i'll think about what a good implementation would look like, and get back to you here.

monitr is kind of a sibling of inspectr, but with a different data backend. my lab, for instance, prefers hdf5 based data storage over sqlite. so we're not using the qcodes dataset, but a simple wrapper around hdf5 that stores each measurement in a separate file (similar to older versions of qcodes or qtlab. it comes with plottr, in plottr.data.datadict_storage). monitr is the (currently very primitive) tool that we use to list the data in the working folder.

@marcosfrenkel marcosfrenkel added the duplicate This issue or pull request already exists label May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants