@@ -372,13 +372,13 @@ class ScriptBuilderTest : public CxxTest::TestSuite {
372
372
" # Child algorithms of TopLevelAlgorithm" ,
373
373
" " ,
374
374
" ## Child algorithms of NestedAlgorithm" ,
375
- " BasicAlgorithm(PropertyA='FirstOne')" ,
376
- " BasicAlgorithm(PropertyA='SecondOne')" ,
375
+ " BasicAlgorithm(PropertyA='FirstOne', StoreInADS=False )" ,
376
+ " BasicAlgorithm(PropertyA='SecondOne', StoreInADS=False )" ,
377
377
" ## End of child algorithms of NestedAlgorithm" ,
378
378
" " ,
379
379
" ## Child algorithms of NestedAlgorithm" ,
380
- " BasicAlgorithm(PropertyA='FirstOne')" ,
381
- " BasicAlgorithm(PropertyA='SecondOne')" ,
380
+ " BasicAlgorithm(PropertyA='FirstOne', StoreInADS=False )" ,
381
+ " BasicAlgorithm(PropertyA='SecondOne', StoreInADS=False )" ,
382
382
" ## End of child algorithms of NestedAlgorithm" ,
383
383
" " ,
384
384
" # End of child algorithms of TopLevelAlgorithm" ,
@@ -419,16 +419,16 @@ class ScriptBuilderTest : public CxxTest::TestSuite {
419
419
" # Child algorithms of TopLevelAlgorithm" ,
420
420
" " ,
421
421
" ## Child algorithms of NestedAlgorithm" ,
422
- " BasicAlgorithm(PropertyA='FirstOne')" ,
423
- " BasicAlgorithm(PropertyA='SecondOne')" ,
422
+ " BasicAlgorithm(PropertyA='FirstOne', StoreInADS=False )" ,
423
+ " BasicAlgorithm(PropertyA='SecondOne', StoreInADS=False )" ,
424
424
" ## End of child algorithms of NestedAlgorithm" ,
425
425
" " ,
426
- " NestedAlgorithm()" ,
426
+ " NestedAlgorithm(StoreInADS=False )" ,
427
427
" # End of child algorithms of TopLevelAlgorithm" ,
428
428
" " ,
429
429
" # Child algorithms of TopLevelAlgorithm" ,
430
- " NestedAlgorithm()" ,
431
- " NestedAlgorithm()" ,
430
+ " NestedAlgorithm(StoreInADS=False )" ,
431
+ " NestedAlgorithm(StoreInADS=False )" ,
432
432
" # End of child algorithms of TopLevelAlgorithm" ,
433
433
" " ,
434
434
" " ,
@@ -604,6 +604,41 @@ class ScriptBuilderTest : public CxxTest::TestSuite {
604
604
m_ads.remove (" IRS21360" );
605
605
}
606
606
607
+ void test_ScriptBuilderWithOutputWorkspaceOutsideOfADS () {
608
+ std::vector<double > xData = {1 , 2 , 3 };
609
+ std::vector<double > yData = {1 , 2 , 3 };
610
+
611
+ auto createWorkspaceAlg = m_algFactory.create (" CreateWorkspace" , 1 );
612
+ createWorkspaceAlg->initialize ();
613
+ createWorkspaceAlg->setProperty (" DataX" , xData);
614
+ createWorkspaceAlg->setProperty (" DataY" , yData);
615
+ createWorkspaceAlg->setProperty (" OutputWorkspace" , " ws" );
616
+ createWorkspaceAlg->setAlwaysStoreInADS (false );
617
+ createWorkspaceAlg->execute ();
618
+
619
+ MatrixWorkspace_sptr ws = createWorkspaceAlg->getProperty (" OutputWorkspace" );
620
+ std::vector<double > params = {1 , 3 , 10 };
621
+ auto rebinAlg = m_algFactory.create (" Rebin" , 1 );
622
+ rebinAlg->initialize ();
623
+ rebinAlg->setProperty (" InputWorkspace" , ws);
624
+ rebinAlg->setProperty (" Params" , params);
625
+ rebinAlg->setProperty (" Power" , 0.5 );
626
+ rebinAlg->setProperty (" OutputWorkspace" , " result" );
627
+ rebinAlg->execute ();
628
+
629
+ auto resultWs = m_ads.retrieveWS <MatrixWorkspace>(" result" );
630
+ auto wsHist = resultWs->getHistory ();
631
+
632
+ ScriptBuilder builder (wsHist.createView ());
633
+ const std::string scriptText = builder.build ();
634
+ const std::string expectedCreateWorkspaceLine =
635
+ " ws = CreateWorkspace(DataX='1,2,3', DataY='1,2,3', StoreInADS=False)" ;
636
+ const std::string expectedRebinLine =
637
+ " Rebin(InputWorkspace=ws, OutputWorkspace='result', Params='1,3,10', Power=0.5)" ;
638
+ TS_ASSERT (scriptText.find (expectedCreateWorkspaceLine) != std::string::npos);
639
+ TS_ASSERT (scriptText.find (expectedRebinLine) != std::string::npos);
640
+ }
641
+
607
642
private:
608
643
AlgorithmFactoryImpl &m_algFactory;
609
644
AnalysisDataServiceImpl &m_ads;
0 commit comments