Ticket #8183 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

PlotMD needs exposing to Python

Reported by: Owen Arnold Owned by: Owen Arnold
Priority: critical Milestone: Release 3.0
Component: Python Keywords:
Cc: Blocked By:
Blocking: #8160, #8185 Tester: Andrei Savici

Description

This has been identified as a requirement in the Horace-Mantid document. See #8160 for details.

  • Refactor to ensure that Plot MD via the GUI will still works
  • Expose all necessary components to python
  • Add a new method to mantidplot.py called plotMD
  • Where possible choose defaults for parameters such as normalization

Change History

comment:1 Changed 7 years ago by Owen Arnold

  • Priority changed from major to critical
  • Milestone changed from Backlog to Release 3.0

comment:2 Changed 7 years ago by Owen Arnold

  • Status changed from new to inprogress

refs #8183. plotMD mantidplot python function.

plotMD is now a new method in mantidplot. Exposed MDNormalization to python as well.

Changeset: 2b167797de2801f08182a8a3011d61f6e407fe3c

comment:3 Changed 7 years ago by Owen Arnold

refs #8183. Hide LineViewerOption.

It does not make sense to expose the log option via the setup dialog for the GUI plot MD option.

Changeset: 17bcf9d7230c8e7ad7ef3911f3e79333223bb32e

comment:4 Changed 7 years ago by Owen Arnold

refs #8183. Plot many MDWorkspaces.

Change the interface so that it allows many MDWorkspaces to be plotted simultaneously. This is more consistent with the plotSpectrum functionality already implemented.

Changeset: 55b5d46223c8770392f62eed618808580d6d8d8d

comment:5 Changed 7 years ago by Owen Arnold

Tester: As an aid for testing, the following python script should demonstrate some of the happy-path use cases.

slice2d = CreateMDWorkspace(Dimensions=2,EventType='MDEvent',Extents='-10,10,-10,10',Names='Q, P',Units='A,A')
FakeMDEventData(InputWorkspace=slice2d,UniformParams='1000',PeakParams='1000,0,0,0.5')
binned = BinMD(InputWorkspace=slice2d,AlignedDim0='Q,-10,10,100',AlignedDim1='P,-1,1,1',OutputWorkspace='binned')

from mantid.api import MDNormalization
t = CreateEmptyTableWorkspace()
plotMD(binned, 0)
plotMD(binned, 0, normalization=MDNormalization.VolumeNormalization)
plotMD(binned, 0, normalization=MDNormalization.NoNormalization)
plotMD(binned, 0, normalization=MDNormalization.NumEventsNormalization)
binned2 = CloneWorkspace(binned)
plotMD(['binned', 'binned2'], 0)

comment:6 Changed 7 years ago by Owen Arnold

refs #8183. Default to auto-select.

Default to auto-select the non-integrated axis.

Changeset: 77b21f447c88713aed67d07fff1f3511265f5cf4

comment:7 Changed 7 years ago by Owen Arnold

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

comment:8 Changed 7 years ago by Owen Arnold

  • Blocking 8185 added

comment:9 Changed 7 years ago by Nick Draper

  • Status changed from verify to verifying
  • Tester set to Nick Draper

comment:10 Changed 7 years ago by Nick Draper

  • Component changed from Framework to Python API

comment:11 Changed 7 years ago by Nick Draper

  • Status changed from verifying to reopened
  • Resolution fixed deleted

Happy path good, handling of non existant workspaces ok. If workspace of wrong type the python sceeds which is misleading - throw!

comment:12 Changed 7 years ago by Owen Arnold

  • Status changed from reopened to inprogress

comment:13 Changed 7 years ago by Owen Arnold

refs #8183. Noisy error reporting.

Changeset: b670480c8e88e9db2545a07ef9c86f02f92d114e

comment:14 Changed 7 years ago by Owen Arnold

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

The following 3 commands, when appended to the original test script should all fail noisily giving good output messages.

plotMD(t, 0)
plotMD(slice2d)
plotMD([binned, slice2d])

comment:15 Changed 7 years ago by Andrei Savici

  • Status changed from verify to verifying
  • Tester changed from Nick Draper to Andrei Savici

comment:16 Changed 7 years ago by Andrei Savici

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/8183_plotmd_python'

Full changeset: b09de58a8e8f68222055480b3fb2387d5bdedce0

comment:17 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9028

Note: See TracTickets for help on using tickets.