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

Modernize event filter gui #23778

Merged
merged 12 commits into from
Oct 16, 2018
Merged

Modernize event filter gui #23778

merged 12 commits into from
Oct 16, 2018

Conversation

peterfpeterson
Copy link
Member

@peterfpeterson peterfpeterson commented Oct 12, 2018

The main task was to make the gui qt4/qt5 compatible so something could be included in the new workbench.

Part of what was done was to refactor a some associated code into an abstraction of the matplotlib backends to access widgets in MPLwidgets and add gui_helper.py to assist in setting the correct matplotlib backend and launch custom guis with less boilerplate code. They should go in mantidqt, but that isn't available from mantidplot currently.

To test:

  • From mantidplot: Interfaces -> Utilities -> FilterEvents
  • From mantidworkbench: Interfaces -> Utilities -> FilterEvents
  • From the commandline: mantidpython .../scripts/FilterEvents.py and mantidpython --classic .../scripts/FilterEvents.py.

This is associated with #23762.

This does not require release notes because workbench.


Reviewer

Please comment on the following (full description):

Code Review
  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there are changes in the release notes then do they describe the changes appropriately?
Functional Tests
  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

@peterfpeterson peterfpeterson added the GUI Issues and pull requests specific to the Mantid Workbench GUI. label Oct 12, 2018
@peterfpeterson peterfpeterson added this to the Release 3.14 (4.0?) milestone Oct 12, 2018
@peterfpeterson peterfpeterson added this to Under Review in Workbench via automation Oct 12, 2018
Copy link
Member

@rosswhitfield rosswhitfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting FilterEvents in the workbench with python2 I get

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5agg.py", line 155, in __draw_idle_agg
    self.draw()
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5agg.py", line 128, in draw
    self.update()
RuntimeError: wrapped C/C++ object of type MplFigureCanvas has been deleted

with python3 I get

Traceback (most recent call last):
  File "/home/rwp/mantid/qt/applications/workbench/workbench/app/mainwindow.py", line 291, in <lambda>
    action.triggered.connect(lambda checked, script=script: self.launchCustomGUI(script))
  File "/home/rwp/mantid/qt/applications/workbench/workbench/app/mainwindow.py", line 254, in launchCustomGUI
    execfile(script)
NameError: name 'execfile' is not define



app = qapp()
app, within_mantid = get_qapplication()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@martyngigg
Copy link
Member

I'm also seeing an error when trying to start it in MantidPlot:

ImportError: cannot import name load_ui
  at line 12 in '<Interface>'
  caused by line 30 in '/media/data1/source/github/mantidproject/mantid/scripts/FilterEvents/eventFilterGUI.py'

@martyngigg
Copy link
Member

Nevermind about my bug above. One of the Python modules hadn't rebuilt properly. It's fine in MantidPlot.

@martyngigg martyngigg merged commit 66a3df7 into master Oct 16, 2018
Workbench automation moved this from Under Review to Closed Oct 16, 2018
@martyngigg martyngigg deleted the modernize_event_filter_gui branch October 16, 2018 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI Issues and pull requests specific to the Mantid Workbench GUI.
Projects
No open projects
Workbench
  
Closed
Development

Successfully merging this pull request may close these issues.

None yet

3 participants