Ticket #3690 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

Cull uses of ExperimentInfo::getBaseInstrument()

Reported by: Russell Taylor Owned by: Russell Taylor
Priority: minor Milestone: Iteration 30
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Martyn Gigg

Description

I suspect that the vast majority (all?) of such calls are unnecessary, and should either be calling just getInstrument() or (especially in the tests) are just getting hold of a pristine instrument to modify - in which case they could just create a new instrument and use setInstrument().

Change History

comment:1 Changed 9 years ago by Russell Taylor

  • Status changed from new to accepted

comment:2 Changed 9 years ago by Russell Taylor

In [14581]:

Eliminate calls to getBaseInstrument in tests. Re #3690.

comment:3 Changed 9 years ago by Russell Taylor

In [14582]:

ExperimentInfo::getBaseInstrument() is gone. If it's really necessary to get hold of the 'naked' instrument then there's a baseInstrument() method on Instrument itself - but it should only be rarely needed. Re #3690.

comment:4 Changed 9 years ago by Russell Taylor

In [14583]:

Forgot to check MantidPlot. Re #3690.

comment:5 Changed 9 years ago by Russell Taylor

In [14598]:

Eliminate calls to baseInstrument() that should be using getComponentID() instead. Re #3690.

comment:6 Changed 9 years ago by Russell Taylor

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

ExperimentInfo::getBaseInstrument is no more. The corresponding method Instrument::baseInstrument (which returned the same thing) is used only 8 times in the code (and 12 in the tests), which is suitably rare.

comment:7 Changed 9 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester set to Martyn Gigg

comment:8 Changed 9 years ago by Martyn Gigg

  • Status changed from verifying to closed

grep returns nothing for getBaseInstrument and a few references to baseInstrument.

Some baseInstrument calls could be removed (some are things that I need to do!).

comment:9 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 4537

Note: See TracTickets for help on using tickets.