Ticket #11316 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Fixes for projection

Reported by: Andrei Savici Owned by: Harry Jeffery
Priority: major Milestone: Release 3.4
Component: Framework Keywords:
Cc: owen.arnold@… Blocked By: #11020
Blocking: Tester: Owen Arnold

Description (last modified by Andrei Savici) (diff)

Ticket #11020 create the projection object. Here are a few things that needs to be changed:

  1. The number of offsets can be any. You can have more than 3. The only requirement is that when you use the projection object, the number of offsets is either 0 or equal to the number of dimensions in the input (or output) workspace in CutMD
  2. Remove comment on line 75 in Code/Mantid/Framework/API/inc/MantidAPI/Projection.h. We always have exactly 3 axes
  3. p=Projection(); x=p.toWorkspace() should put the x workspace in the ADS
  4. Modifying the workspace should change the projection object as well.

Change History

comment:1 Changed 6 years ago by Andrei Savici

  • Description modified (diff)

comment:2 Changed 6 years ago by Harry Jeffery

  • Blocked By 11020 added

comment:3 follow-up: ↓ 4 Changed 6 years ago by Harry Jeffery

  1. seems troublesome regarding scope. Once you've got data binding in one direction, the users will be confused that it's not also updated in the other direction, so we'd end up adding support for that too. At that point all we've achieved is a weird storage back-end for a specialised table workspace. I think the problem here stems from ambiguous intentions, as the workspace is not a view of the projection itself, but an output generated from it. I think it would make things much clearer if I renamed the toWorkspace method to createWorkspace to clarify that it's an output, not a conversion/cast.

comment:4 in reply to: ↑ 3 Changed 6 years ago by Owen Arnold

Replying to Harry Jeffery:

  1. seems troublesome regarding scope. Once you've got data binding in one direction, the users will be confused that it's not also updated in the other direction, so we'd end up adding support for that too. At that point all we've achieved is a weird storage back-end for a specialised table workspace. I think the problem here stems from ambiguous intentions, as the workspace is not a view of the projection itself, but an output generated from it. I think it would make things much clearer if I renamed the toWorkspace method to createWorkspace to clarify that it's an output, not a conversion/cast.

I agree with Harry on this point. The only way to handle this kind of thing would be to make the Projection a subtype of an ITableWorkspace (like the PeaksWorkspace), which would be a lot of work to the entire framework. If users are really keen on that then we could do it, but it would be several weeks work I think.

comment:5 Changed 6 years ago by Harry Jeffery

I also have a couple of questions about 1.

If the number of offsets is either 0 or the number of input/output workspace dimensions, how many input/output workspace dimensions can there be? 0-n? If the projection is always three dimensional, can the number of input/output dimensions not also be assumed to be three?

Supporting more than 3 will require changing the TableWorkspace format. When there's unused offsets, we shouldn't need to do anything as they'll be set to 0 by default.

I've implemented points 2 and 3, but have not yet pushed them.

comment:6 Changed 6 years ago by Harry Jeffery

  • Status changed from new to inprogress

Refs #11316 Add createWorkspace method to projection

Changeset: 51218fccfec914512c40a351375b55a7cffa87e8

comment:7 Changed 6 years ago by Harry Jeffery

Refs #11316 Update CutMD documentation

Changeset: 0acf0df82db3cf3e034813831693da37b53195bc

comment:8 Changed 6 years ago by Harry Jeffery

Refs #11316 Remove obsolete comment

Changeset: d5b7bb5a5e35295c04ba94c7356c27e9b1d2f9d7

comment:9 Changed 6 years ago by Harry Jeffery

Refs #11316 Add unit test for ADS pushing

Changeset: cf711513376ce356ede7781f1bc4d2a651c7a503

comment:10 Changed 6 years ago by Harry Jeffery

Refs #11316 Remove unused import from usage example

Changeset: dc5d801b02739f1752301666af23cad88e1236cb

comment:11 Changed 6 years ago by Harry Jeffery

Refs #11316 Test workspace creation more thoroughly

Changeset: 236727e2a559a5a1f619578b26caf4cfeedca0de

comment:12 Changed 6 years ago by Harry Jeffery

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

This is being verified as pull request #386.

comment:13 Changed 6 years ago by Harry Jeffery

Refs #11316 Don't use Python 2.7 features

RHEL6 doesn't like them.

Changeset: 451eb34b868762bc291ca729367f4552e1063e72

comment:14 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:15 Changed 6 years ago by Owen Arnold

  • Status changed from verify to verifying
  • Tester set to Owen Arnold

comment:16 Changed 6 years ago by Owen Arnold

Passes my tests. Unfortunately it is possible to misuse this, but it's not something that we can do anything about. For example this silently breaks.

CutMD(InputWorkspace='hkl', P1Bin='-0.1,0.01,0.7', P2Bin='-0.7,0.01,0.5', P3Bin='-1,1', P4Bin='0.1,0.2',Projection=p.createWorkspace(), NoPix=True)

Because there is no lhs.

comment:17 Changed 6 years ago by Owen Arnold

  • Status changed from verifying to closed

Merge pull request #386 from mantidproject/11316_fixes_for_projection

Fixes for Projection workspace creation

Full changeset: 0bfe659a9c08a26354a94ffe5f0f4dbba3d3d04e

comment:18 Changed 5 years ago by Nick Draper

Somehow these slipped through without a resolution. Set to Fixed.

comment:19 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 12155

Note: See TracTickets for help on using tickets.