Skip to content

Commit

Permalink
refs #3641. Improve speed by loading minimal on event data.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed Jan 6, 2012
1 parent 12405b0 commit 977cb2e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace MantidQt
alg->setPropertyValue("OutputWorkspace", m_adsID);
if(protocol == MinimalData)
{
//Peform as speed up here to fetch the minimum amount of data.
alg->setProperty("MetaDataOnly", true);
}
alg->execute();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ class EventNexusFileMementoTest : public CxxTest::TestSuite
TSM_ASSERT("Should have fetched the workspace", result);
}

void testFetchMinimalData()
{
EventNexusFileMemento memento(getSuitableFileNamePath());
IEventWorkspace_sptr result = boost::dynamic_pointer_cast<IEventWorkspace>(memento.fetchIt(MinimalData));
TS_ASSERT_EQUALS(0, result->getNumberEvents());
}

void testFetchEverything()
{
EventNexusFileMemento memento(getSuitableFileNamePath());
IEventWorkspace_sptr result = boost::dynamic_pointer_cast<IEventWorkspace>(memento.fetchIt(Everything));
TS_ASSERT(result->getNumberEvents() > 1);
}

void testNoExistingUB()
{
EventNexusFileMemento memento(getSuitableFileNamePath());
Expand All @@ -58,6 +72,7 @@ class EventNexusFileMementoTest : public CxxTest::TestSuite
EventNexusFileMemento memento(getSuitableFileNamePath());
memento.setUB(0,0,2,0,4,0,-8,0,0);
IEventWorkspace_sptr ws = boost::dynamic_pointer_cast<IEventWorkspace>(memento.applyActions());
TS_ASSERT(ws->getNumberEvents() > 1);
std::vector<double> ub = ws->sample().getOrientedLattice().getUB().get_vector();
TS_ASSERT_EQUALS(0, ub[0]);
TS_ASSERT_EQUALS(0, ub[1]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class RawFileMementoTest : public CxxTest::TestSuite
RawFileMemento memento(getSuitableFileNamePath());
memento.setUB(0,0,2,0,4,0,-8,0,0);
MatrixWorkspace_sptr ws = boost::dynamic_pointer_cast<MatrixWorkspace>(memento.applyActions());
TS_ASSERT(ws->getNumberHistograms() > 1);
std::vector<double> ub = ws->sample().getOrientedLattice().getUB().get_vector();
TS_ASSERT_EQUALS(0, ub[0]);
TS_ASSERT_EQUALS(0, ub[1]);
Expand Down

0 comments on commit 977cb2e

Please sign in to comment.