Ticket #3784 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

Certain instrument view python commands don't work

Reported by: Martyn Gigg Owned by: Russell Taylor
Priority: critical Milestone: Release 2.0
Component: MantidPlot Keywords:
Cc: Blocked By:
Blocking: Tester: Alex Buts

Description

While testing the commands at http://www.mantidproject.org/MantidPlot:_Viewing_the_Instrument_from_Python it became apparent that the setBinRange and selectComponent methods no longer worked.

The idea of these methods was that the values could be set before any rendering/integration had happened and when the window was shown it would be set to the values given in the scripts.

I.e. Setting the bin range should mean only calculating the integration once rather than calculaing the whole range on start up and then again when set.

Change History

comment:1 Changed 9 years ago by Nick Draper

  • Owner set to Anyone
  • type changed from enhancement to defect
  • Status changed from new to assigned
  • Component changed from Mantid to MantidPlot
  • Priority changed from major to critical

comment:2 Changed 9 years ago by Russell Taylor

A couple of other comments about accessing the instrument window from Python:

  • If you enter a workspace name that doesn't exist into getInstrumentView, it silently fails (you get a NoneType back).
  • Similarly, entering an incorrect path to a colormap silently does nothing.

comment:3 Changed 9 years ago by Andrei Savici

  • Status changed from assigned to accepted
  • Owner changed from Anyone to Andrei Savici

comment:4 Changed 9 years ago by Andrei Savici

  • Status changed from accepted to verify
  • Resolution set to worksforme

This works for me:

Load('CNCS_7860_event.nxs','w')
instrument_view = getInstrumentView('w')
instrument_view.setColorMapMinValue(10.0)
instrument_view.setColorMapMaxValue(100.0)
instrument_view.show()

The default range is 0 to 175.

You might try in the python script:

if instrument_view==None:
   raise ValueError("workspace name not found or getInstrumentView failed")

comment:5 Changed 9 years ago by Russell Taylor

  • Status changed from verify to reopened
  • Resolution worksforme deleted
  • Summary changed from Instrument view python commands don't work to Certain instrument view python commands don't work

The ticket title (which I've now changed) needed to be read in conjunction with the description! Only some commands were not working. In fact, 'setBinRange' does work now but 'selectComponent' still doesn't (for me).

comment:6 Changed 9 years ago by Andrei Savici

  • Status changed from reopened to assigned
  • Owner changed from Andrei Savici to Anyone

comment:7 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 32 to Iteration 33

Moved to iteration 33 at iteration 32 code freeze

comment:8 Changed 9 years ago by Russell Taylor

  • Milestone changed from Iteration 33 to Iteration 32

Since this release is big on python features, it would be good to get this working if anyone has time to look at it (I may do, but not today).....

comment:9 Changed 9 years ago by Nick Draper

  • Owner changed from Anyone to Russell Taylor

Martyn and Roman both have their hands full, could you pick this one up if you have the time

comment:10 Changed 9 years ago by Russell Taylor

  • Status changed from assigned to accepted

comment:11 Changed 9 years ago by Russell Taylor

Add zooming to the named component when selecting a component

from python. Re #3784.

Changeset: 2a7e2ca238274dccd7e95910b19c5ef47e604838

comment:12 Changed 9 years ago by Russell Taylor

Delay apparition of 'busy' cursor. Re #3784.

Changeset: 97c4a5f19b025a06c547fc417618754c68b6a6c0

comment:13 Changed 9 years ago by Russell Taylor

Remove exposure of redundant method that didn't work anyway! Re #3784

Changeset: ea34dae9dc3d281f7871bf41bfceedebfc65b12f

comment:14 Changed 9 years ago by Russell Taylor

All the exposed methods of InstrumentWindow work now, and are documented in the wiki.

What DOESN'T happen now is the instrument window starting out hidden on creation from python. I know how I would normally sort this out, but the floating windows business (#4282) seems to have made this a bit of a mess.

comment:15 Changed 9 years ago by Russell Taylor

Instrument Window starts out hidden when created from python.

Unfortunately it flickers up briefly if the instrument window is docked (not the default), but I couldn't navigate my way through the floating windows minefield to stop that happening. Re #3784.

Changeset: 6687128eca5ad8b62a282efec6655852f774be82

comment:16 Changed 9 years ago by Russell Taylor

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:17 Changed 9 years ago by Alex Buts

  • Status changed from verify to verifying
  • Tester set to Alex Buts

comment:18 Changed 9 years ago by Alex Buts

  • Status changed from verifying to closed

Tested on Win only.

Offending methods work fine. So all methods, mentioned on the web-page.

Floating windows behave strangely, for which a separate ticket #4541 has been risen.

comment:19 Changed 9 years ago by Russell Taylor

Add zooming to the named component when selecting a component

from python. Re #3784.

Changeset: 2a7e2ca238274dccd7e95910b19c5ef47e604838

comment:20 Changed 9 years ago by Russell Taylor

Delay apparition of 'busy' cursor. Re #3784.

Changeset: 97c4a5f19b025a06c547fc417618754c68b6a6c0

comment:21 Changed 9 years ago by Russell Taylor

Remove exposure of redundant method that didn't work anyway! Re #3784

Changeset: ea34dae9dc3d281f7871bf41bfceedebfc65b12f

comment:22 Changed 9 years ago by Russell Taylor

Instrument Window starts out hidden when created from python.

Unfortunately it flickers up briefly if the instrument window is docked (not the default), but I couldn't navigate my way through the floating windows minefield to stop that happening. Re #3784.

Changeset: 6687128eca5ad8b62a282efec6655852f774be82

comment:23 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 4631

Note: See TracTickets for help on using tickets.