anesthetic icon indicating copy to clipboard operation
anesthetic copied to clipboard

Features for GUI

Open lukashergt opened this issue 4 years ago • 18 comments

With discussions (see e.g. #33, #82) about changes to the anesthetic GUI, I thought it might be good to collect some ideas for improvements. Many of these points probably hinge on whether we decide to really go through with a more extensive (e.g. with QML?) GUI overhaul.

  • [ ] Legend with root name: Automatically produce a legend in the top right corner of the triangle plot, such that you can distinguish two runs when you are comparing them in side-by-side windows. Probably best to strip the root from its path and only keep the file root.

  • [ ] Option to show logZ, D_KL, d: Maybe put in a switch to change the triangle plot of the parameters to one of the ns_output method.

  • [ ] Run GUI without root specification: Bring the root specification into the GUI instead of having to specify at terminal invocation. This will help with the next point.

  • [ ] Allow switching between roots: Allow to switch between different roots, e.g. through a text box where you can specify the root or even through a file browsing functionality.

  • [ ] alpha for scatter plots: Introduce an alpha kwarg for the 2d scatter plots such that different density regions are a little easier to distinguish.

lukashergt avatar Jun 01 '20 10:06 lukashergt

  • [x] Make UI responsive: currently too many plots are recomputed. Also, plots are rendered to a peplos canvas, while they could be rendered to a texture and displayed, which is much faster.
  • [x] Add the option to display additional plots. e.g. add the option to include the histograms, the posterior plots (not just the posterior samples).
  • [x] Adjust layout: It's not bad, but buttons are hard to read...
  • [x] decouple business logic from display logic.
  • [x] allow including any plot that anesthetic can produce. Right now only a limited number of plots are available.

appetrosyan avatar Jun 03 '20 18:06 appetrosyan

Dear @lukashergt , I have a work-in-progress repository, if you like to give it a test drive and leave some feedback. Right now, installation is

git clone [email protected]:appetrosyan/paranestamol.git
cd paranestamol && python3 setup.py 
python3 -c "import paranestamol.main \
paranestamol.main.main()

appetrosyan avatar Jun 22 '20 15:06 appetrosyan

Hi @appetrosyan,

I've taken screenshots of the two windows that show some obvious display issues. I'm not sure what exactly they are supposed to look like, you'll be a better judge of that.

I first didn't know how to even get to the second window, only accidentally found that I had to swipe instead of click. The plot was sharp in the first instant but then went blurry when trying to adjust the slider.

Screenshot_2020-06-23_00-08-48 Screenshot_2020-06-23_00-09-11

lukashergt avatar Jun 22 '20 23:06 lukashergt

  • [x] Good! So the second window is supposed to work by clicking the indicator on the bottom, (and swiping, and clicking the right side of the screen). I’ll get to work on fixing that. Maybe add an arrow pointing right.

  • [x] The first window has some hard-coded width and heights, I’ll get to work on that. (oh and you can drag and drop into it to load samples).

  • [x] The trick about the second window is it needs to go blurry while updating the contents, and then get back to being sharp when it’s done. I’m working on caching the results for multiple values of Beta, so this should happen only rarely.

  • [x] Did it produce any stack traces? The curves in the second window are supposed to be the same colour as the squares near the checkbox.

appetrosyan avatar Jun 23 '20 05:06 appetrosyan

It might be good if you also tested it out on CSD3. That way you can get a better and more direct feel for potential issues on other platforms.

lukashergt avatar Jun 23 '20 15:06 lukashergt

@lukashergt I have a fresh branch to have a look at.

I fixed the layout issues, added some stats to the first screen, added the ability to edit the legend colours, alpha, added the manipulators for logL and beta (not logarithmic), and cleaned up most of the issues that we last talked about.

There are two branches: the master is the latest stable, and there's async plotting. If you have the time, have a look at both, but preferably the stable branch first. The async plotting is what the final user experience should look like eventually. It doesn't crash often, but I need to figure out what's causing it and (hopefully) fix it.

Any critique and caught bugs are welcome.

https://github.com/appetrosyan/paranestamol/tree/async-plotting

appetrosyan avatar Jun 26 '20 16:06 appetrosyan

The readme is not part of the master branch yet. Was a bit lost at first not knowing what to do. Would be good to make that part of master.

lukashergt avatar Jun 26 '20 17:06 lukashergt

Did you manage to get it running on CSD3? I'm getting ImportError: Failed to import any qt binding there, despite having e.g. PySide2, matplotlib-backend-qtquick and PyQt5...

lukashergt avatar Jun 26 '20 17:06 lukashergt

@lukashergt Try

pip uninstall matplotlib
python -m pip install --upgrade pip
pip install matplotlib

appetrosyan avatar Jun 26 '20 17:06 appetrosyan

This is odd. I did get it running on CSD3, a Windows Bootcamp, and my desktop PC: ArchLinux in both bspwm and sway.

appetrosyan avatar Jun 26 '20 17:06 appetrosyan

@lukashergt Try

pip uninstall matplotlib
python -m pip install --upgrade pip
pip install matplotlib

Already did...

Hmm, that is odd. Did you run it in a virtual environment on CSD3? Which modules did you load?

lukashergt avatar Jun 26 '20 17:06 lukashergt

Yes. pipenv.

On CSD3 the stock module load python/3.8 did the basic task. The rest was just pip installed.

appetrosyan avatar Jun 26 '20 17:06 appetrosyan

Yes. pipenv.

On CSD3 the stock module load python/3.8 did the basic task. The rest was just pip installed.

I already set up a completely new virtualenv with 3.8 and didn't get it to work...

lukashergt avatar Jun 26 '20 17:06 lukashergt

I checked back. I'm getting the same error on CSD3 now. I'll get back to you when I know how to fix it.

appetrosyan avatar Jun 26 '20 18:06 appetrosyan

Can you import PySide2.QtCore? On CSD3 this produces an error (it didn’t yesterday).

appetrosyan avatar Jun 26 '20 19:06 appetrosyan

Nope, same error. Weird, maybe something to be raised with the support team?

lukashergt avatar Jun 26 '20 19:06 lukashergt

One piece of feedback I've got from the anesthetic slider is that the slider chooses logL (by iteration), but the higson plot shows logX, and this gap is not very intuitive. logX is probably the more natural thing to control in terms of how the live points evolve.

williamjameshandley avatar Jun 27 '20 21:06 williamjameshandley

@williamjameshandley , I have a prototype of an impelmentation of the higson plot, however it still suffers from the #83, and since we’ve touched upon it, maybe we could move the discussion to a new issue.

appetrosyan avatar Jun 27 '20 21:06 appetrosyan