Ticket #2319 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Add an IAlgorithm method to easily run sub-algs

Reported by: Mathieu Doucet Owned by: Mathieu Doucet
Priority: trivial Milestone: Iteration 27
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Janik Zikovsky

Description

Add a utility method so that we don't have to write the following code each time an Algorithm runs a sub-algorithm:

  // Now execute the sub-algorithm. Catch and log any error
  try
  {
    childAlg->execute();
  }
  catch (std::runtime_error&)
  {
    g_log.error("Unable to successfully run Linear fit sub-algorithm");
    throw;
  }

  if ( ! childAlg->isExecuted() )
  {
    g_log.error("Unable to successfully run Linear fit sub-algorithm");
    throw std::runtime_error("Unable to successfully run Linear fit sub-algorithm");
  }

Change History

comment:1 Changed 10 years ago by Mathieu Doucet

  • Status changed from new to accepted

comment:2 Changed 10 years ago by Mathieu Doucet

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

(In [9009]) Added executeAsSubAlg(). Fixes #2319

comment:3 Changed 10 years ago by Janik Zikovsky

  • Status changed from verify to verifying
  • Tester set to Janik Zikovsky

comment:4 Changed 10 years ago by Janik Zikovsky

  • Status changed from verifying to closed

These algorithms work. See #2426 for a ticket to use this feature more.

comment:5 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 3166

Note: See TracTickets for help on using tickets.