Skip to content

Commit

Permalink
refs #6841 ok -- this is the consequences of fixing on develop
Browse files Browse the repository at this point in the history
The branch itself should be clean.

Merge branch 'feature/6841_MergeMDAddsExperimentInfo' of https://github.com/mantidproject/mantid into develop

Conflicts:
	Code/Mantid/Framework/MDAlgorithms/src/MergeMD.cpp
  • Loading branch information
abuts committed Apr 8, 2013
2 parents b7c2e32 + 88a07e8 commit 95089c6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
28 changes: 16 additions & 12 deletions Code/Mantid/Framework/MDAlgorithms/src/MergeMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,22 @@ namespace MDAlgorithms
// Perform the initial box splitting
out->splitBox();

//// copy experiment infos
// uint16_t nExperiments(0);
// if(m_workspaces.size()>std::numeric_limits<uint16_t>::max())
// throw std::invalid_argument("currently we can not combine more then 65535 experiments");
// else
// nExperiments = static_cast<uint16_t>(m_workspaces.size());

// for (uint16_t i=0; i < nExperiments; i++)
// {
// API::ExperimentInfo_sptr ei = API::ExperimentInfo_sptr(m_workspaces[i]->getExperimentInfo(i)->cloneExperimentInfo());
// out->addExperimentInfo(ei);
// }
// copy experiment infos
uint16_t nExperiments(0);
if(m_workspaces.size()>std::numeric_limits<uint16_t>::max())
throw std::invalid_argument("currently we can not combine more then 65535 experiments");
else
nExperiments = static_cast<uint16_t>(m_workspaces.size());

for (uint16_t i=0; i < nExperiments; i++)
{
uint16_t nWSexperiments = m_workspaces[i]->getNumExperimentInfo();
for(uint16_t j=0;j<nWSexperiments;j++)
{
API::ExperimentInfo_sptr ei = API::ExperimentInfo_sptr(m_workspaces[i]->getExperimentInfo(j)->cloneExperimentInfo());
out->addExperimentInfo(ei);
}
}

}

Expand Down
2 changes: 2 additions & 0 deletions Code/Mantid/Framework/MDAlgorithms/test/MergeMDTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ class MergeMDTest : public CxxTest::TestSuite
TS_ASSERT_DELTA( dim->getMinimum(), -5.0, 1e-3);
TS_ASSERT_DELTA( dim->getMaximum(), +20.0, 1e-3);
}

TS_ASSERT_EQUALS(3,ws->getNumExperimentInfo());

// Remove workspace from the data service.
AnalysisDataService::Instance().remove(outWSName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ namespace MDEventsTestHelper
}
out->refreshCache();
}
auto ei = API::ExperimentInfo_sptr(new API::ExperimentInfo());
out->addExperimentInfo(ei);

// Add to ADS on option
if (!wsName.empty())
Expand Down

0 comments on commit 95089c6

Please sign in to comment.