Ticket #2049 (assigned)

Opened 10 years ago

Last modified 5 years ago

Consider having one runLoadInstrument() implementation in a helper class

Reported by: Anders Markvardsen Owned by: Karl Palmen
Priority: minor Milestone: Backlog
Component: Framework Keywords: maintenance
Cc: Blocked By:
Blocking: Tester:

Description (last modified by Stuart Campbell) (diff)

Nearly all the loaders how a runLoadInstrument methods which appart from in LoadEmptyInstrument does the same job. Consider created a helper class to put in API or elsewhere which can be accessed from the Nexus and DataHandling loaders and which has a common implementation of runLoadInstrument (other code which is replicated in the loaders may also be put in this helper class).

Note doing a search for runLoadInstrument gives the result:

  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\inc\MantidDataHandling\LoadCanSAS1D.h(88):      void runLoadInstrument(const std::string & inst_name, API::MatrixWorkspace_sptr localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\inc\MantidDataHandling\LoadDAE.h(94):      void runLoadInstrument(DataObjects::Workspace2D_sptr, const char* iName);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\inc\MantidDataHandling\LoadEmptyInstrument.h(75):      API::MatrixWorkspace_sptr runLoadInstrument();
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\inc\MantidDataHandling\LoadEventPreNeXus.h(179):  void runLoadInstrument(const std::string &eventfilename, API::MatrixWorkspace_sptr localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\inc\MantidDataHandling\LoadPreNeXusMonitors.h(77):  void runLoadInstrument(const std::string& instrument, API::MatrixWorkspace_sptr localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\inc\MantidDataHandling\LoadRaw.h(86):      void runLoadInstrument(DataObjects::Workspace2D_sptr);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\inc\MantidDataHandling\LoadRaw.h(87):      void runLoadInstrumentFromRaw(DataObjects::Workspace2D_sptr);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\inc\MantidDataHandling\LoadRaw2.h(88):      void runLoadInstrument(DataObjects::Workspace2D_sptr);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\inc\MantidDataHandling\LoadRaw2.h(89):      void runLoadInstrumentFromRaw(DataObjects::Workspace2D_sptr);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\inc\MantidDataHandling\LoadRawHelper.h(102):      void runLoadInstrument(const std::string& fileName,DataObjects::Workspace2D_sptr);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\inc\MantidDataHandling\LoadRawHelper.h(105):      void runLoadInstrumentFromRaw(const std::string& fileName,DataObjects::Workspace2D_sptr);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\inc\MantidDataHandling\LoadSpice2D.h(76):      void runLoadInstrument(const std::string & inst_name,DataObjects::Workspace2D_sptr localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadCanSAS1D.cpp(193):  runLoadInstrument(instname, dataWS);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadCanSAS1D.cpp(233):void LoadCanSAS1D::runLoadInstrument(const std::string & inst_name,
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadDAE.cpp(366):          runLoadInstrument(localWorkspace, iName);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadDAE.cpp(457):    void LoadDAE::runLoadInstrument(DataObjects::Workspace2D_sptr localWorkspace, const char* iName)
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadEmptyInstrument.cpp(61):      MatrixWorkspace_sptr ws = this->runLoadInstrument();
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadEmptyInstrument.cpp(114):    API::MatrixWorkspace_sptr LoadEmptyInstrument::runLoadInstrument()
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadEventPreNeXus.cpp(236):  this->runLoadInstrument(event_filename, localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadEventPreNeXus.cpp(267):void LoadEventPreNeXus::runLoadInstrument(const std::string &eventfilename, MatrixWorkspace_sptr localWorkspace)
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadEventPreNeXus.cpp(316)://    runLoadInstrumentFromRaw(fileName,localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadPreNeXusMonitors.cpp(227):  this->runLoadInstrument(instrumentName, localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadPreNeXusMonitors.cpp(242):void LoadPreNeXusMonitors::runLoadInstrument(const std::string &instrument,
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadRaw.cpp(179):          runLoadInstrument(localWorkspace );
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadRaw.cpp(326):    void LoadRaw::runLoadInstrument(DataObjects::Workspace2D_sptr localWorkspace)
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadRaw.cpp(369):        runLoadInstrumentFromRaw(localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadRaw.cpp(374):    void LoadRaw::runLoadInstrumentFromRaw(DataObjects::Workspace2D_sptr localWorkspace)
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadRaw2.cpp(155):        runLoadInstrument(localWorkspace );
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadRaw2.cpp(239):          runLoadInstrument(localWorkspace );
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadRaw2.cpp(356):    void LoadRaw2::runLoadInstrument(DataObjects::Workspace2D_sptr localWorkspace)
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadRaw2.cpp(403):        runLoadInstrumentFromRaw(localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadRaw2.cpp(408):    void LoadRaw2::runLoadInstrumentFromRaw(DataObjects::Workspace2D_sptr localWorkspace)
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadRaw3.cpp(128):  runLoadInstrument(m_filename,localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadRaw3.cpp(547):  runLoadInstrument(fileName,localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadRawHelper.cpp(547):    void LoadRawHelper::runLoadInstrument(const std::string& fileName,DataObjects::Workspace2D_sptr localWorkspace)
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadRawHelper.cpp(584):        runLoadInstrumentFromRaw(fileName,localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadRawHelper.cpp(600):    void LoadRawHelper::runLoadInstrumentFromRaw(const std::string& fileName,DataObjects::Workspace2D_sptr localWorkspace)
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadSpice2D.cpp(269):      runLoadInstrument(instrument, ws);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\DataHandling\src\LoadSpice2D.cpp(309):    void LoadSpice2D::runLoadInstrument(const std::string & inst_name,
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\inc\MantidNexus\LoadISISNexus.h(100):            void runLoadInstrument(DataObjects::Workspace2D_sptr);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\inc\MantidNexus\LoadISISNexus2.h(84):      void runLoadInstrument(DataObjects::Workspace2D_sptr);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\inc\MantidNexus\LoadMuonNexus.h(81):      void runLoadInstrument(DataObjects::Workspace2D_sptr);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\inc\MantidNexus\LoadMuonNexus.h(115):      void runLoadInstrumentFromNexus(DataObjects::Workspace2D_sptr);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\inc\MantidNexus\LoadMuonNexus2.h(81):      //void runLoadInstrument(API::MatrixWorkspace_sptr localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\inc\MantidNexus\LoadNexusMonitors.h(68):    void runLoadInstrument(const std::string& instrument,
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\inc\MantidNexus\LoadNexusProcessed.h(99):      void runLoadInstrument(const std::string & inst_name, DataObjects::Workspace2D_sptr local_workspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\inc\MantidNexus\LoadSNSEventNexus.h(109):      void runLoadInstrument(const std::string &nexusfilename, API::MatrixWorkspace_sptr localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\inc\MantidNexus\LoadTOFRawNeXus.h(90):  void runLoadInstrument(DataObjects::Workspace2D_sptr);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadISISNexus.cpp(164):            runLoadInstrument(localWorkspace );
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadISISNexus.cpp(173):          runLoadInstrument(localWorkspace );
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadISISNexus.cpp(471):    void LoadISISNexus::runLoadInstrument(DataObjects::Workspace2D_sptr localWorkspace)
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadISISNexus.cpp(515):      //    runLoadInstrumentFromNexus(localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadISISNexus2.cpp(202):      runLoadInstrument(local_workspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadISISNexus2.cpp(515):    void LoadISISNexus2::runLoadInstrument(DataObjects::Workspace2D_sptr localWorkspace)
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadISISNexus2.cpp(559):      //    runLoadInstrumentFromNexus(localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadMuonNexus.cpp(180):            runLoadInstrument(localWorkspace );
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadMuonNexus.cpp(188):          runLoadInstrument(localWorkspace );
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadMuonNexus.cpp(454):    void LoadMuonNexus::runLoadInstrument(DataObjects::Workspace2D_sptr localWorkspace)
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadMuonNexus.cpp(497):        runLoadInstrumentFromNexus(localWorkspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadMuonNexus.cpp(502):    void LoadMuonNexus::runLoadInstrumentFromNexus(DataObjects::Workspace2D_sptr localWorkspace)
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadMuonNexus2.cpp(175):          runLoadInstrument(localWorkspace );
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadNexusMonitors.cpp(161):  this->runLoadInstrument(instrumentName, this->WS);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadNexusMonitors.cpp(174):void LoadNexusMonitors::runLoadInstrument(const std::string &instrument,
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadNexusProcessed.cpp(435):  runLoadInstrument(instname, local_workspace);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadNexusProcessed.cpp(981):void LoadNexusProcessed::runLoadInstrument(const std::string & inst_name,
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadSNSEventNexus.cpp(163):  runLoadInstrument(m_filename, WS);
  C:\Documents and Settings\ajm64\Desktop\Mantid\Code\Mantid\Nexus\src\LoadSNSEventNexus.cpp(532):void LoadSNSEventNexus::runLoadInstrument(const std::string &nexusfilename, MatrixWorkspace_sptr localWorkspace)

Attachments

runLoadInstrumentSearch.txt (9.9 KB) - added by Karl Palmen 5 years ago.
A list of files containing runLoadInstrument (21 May 2015)

Change History

comment:1 Changed 10 years ago by Nick Draper

  • Owner set to Anders Markvardsen
  • Status changed from new to assigned

comment:2 Changed 10 years ago by Nick Draper

  • Milestone changed from Iteration 27 to Iteration 28

Bulk move of tickets at the end of iteration 27

comment:3 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 28 to Iteration 29

Bulk move of tickets at the end of iteration 28

comment:4 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 29 to Iteration 30

Accepted and assigned tickets moved at iteration 29 code freeze

comment:5 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 30 to Iteration 31

Bulk move of tickets to iteration 31 at the iteration 30 code freeze

comment:6 Changed 9 years ago by Anders Markvardsen

  • Owner changed from Anders Markvardsen to Karl Palmen

comment:7 Changed 9 years ago by Anders Markvardsen

Estimated to take three man days

comment:8 Changed 9 years ago by Karl Palmen

  • Owner changed from Karl Palmen to Martyn Gigg

Investigation shows that this would require the transfer of a call of the CreateSubAlgorithm function to the helper class and this function call would not work there without a modification of the Algorithm class. I reassign this query to Martyn Gigg who is currently working on the Algorithm class.

comment:9 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:10 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.1 to Release 2.2

Moved at end of release 2.1

comment:11 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.2 to Release 2.3

Moved at the end of release 2.2

comment:12 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.3 to Release 2.4

Moved to milestone 2.4

comment:13 Changed 8 years ago by Martyn Gigg

  • Milestone changed from Release 2.4 to Release 2.5

comment:14 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.5 to Release 2.6

Moved to r2.6 at the end of r2.5

comment:15 Changed 7 years ago by Karl Palmen

  • Owner changed from Martyn Gigg to Karl Palmen

comment:16 Changed 7 years ago by Karl Palmen

The helper function can have a pointer to the algorithm as an argument as LoadEventNexus::runLoadInstrument does at present.

comment:17 Changed 7 years ago by Karl Palmen

An astrogrep at runLoadInstrument reveals they have arguments as follows (ignoring order):

(): LoadEmptyInstrument, LoadILL, LoadLLB, LoadSINQ,

(workspace): LoadISISNexus2, LoadMuonNexus(v)

(IDFfilename, workspace, Alg): AppendGeometryToSNSNexus

(instrumentName, workspace): ISISHistoDataListener, LoadCanSAS1D(2), LoadDAE, LoadNexusMonitors, LoadPreNexusMonitors, LoadSpice2D, SANSInstrumentCreationHelper

(NEXUSfilename, workspace, top_entry, Alg): LoadEventNexus

(NEXUSfilename, workspace): LoadEventPreNexus(2)

(RAWfilename, workspace, progStart, progEnd): LoadRawHelper
Last edited 5 years ago by Stuart Campbell (previous) (diff)

comment:18 Changed 7 years ago by Nick Draper

  • Status changed from assigned to new

comment:19 Changed 7 years ago by Nick Draper

  • Component changed from Mantid to Framework

comment:20 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.6 to Backlog

Moved to backlog at the code freeze for R2.6

comment:21 Changed 7 years ago by Nick Draper

  • Status changed from new to assigned

bulk move to assigned at the into of the triage step

comment:22 Changed 5 years ago by Stuart Campbell

  • Description modified (diff)

comment:23 in reply to: ↑ description Changed 5 years ago by Karl Palmen

  • Keywords maintenance added

This was intended to be an improvement of the English in the ticket description, but I did not know my way around Trac well enough to edit the description at first.

Last edited 5 years ago by Karl Palmen (previous) (diff)

Changed 5 years ago by Karl Palmen

A list of files containing runLoadInstrument (21 May 2015)

comment:24 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 2896

Note: See TracTickets for help on using tickets.