Skip to content
Snippets Groups Projects
Unverified Commit 04fa00ec authored by Simon Heybrock's avatar Simon Heybrock Committed by GitHub
Browse files

Merge pull request #21320 from mantidproject/21319_algorithms_for_GroupWorkspaces

Algorithms with optional workspace output properties can not run on group workspaces 
parents fbda1d94 2fc6abe6
No related merge requests found
......@@ -775,7 +775,7 @@ void Algorithm::setupAsChildAlgorithm(Algorithm_sptr alg,
for (auto prop : props) {
auto wsProp = dynamic_cast<IWorkspaceProperty *>(prop);
if (prop->direction() == Mantid::Kernel::Direction::Output && wsProp) {
if (prop->value().empty()) {
if (prop->value().empty() && !wsProp->isOptional()) {
prop->createTemporaryValue();
}
}
......@@ -1301,7 +1301,7 @@ bool Algorithm::processGroups() {
// ---------- Create all the output workspaces ----------------------------
for (auto &pureOutputWorkspaceProp : m_pureOutputWorkspaceProps) {
Property *prop = dynamic_cast<Property *>(pureOutputWorkspaceProp);
if (prop) {
if (prop && !prop->value().empty()) {
auto outWSGrp = boost::make_shared<WorkspaceGroup>();
outGroups.push_back(outWSGrp);
// Put the GROUP in the ADS
......@@ -1370,6 +1370,8 @@ bool Algorithm::processGroups() {
dynamic_cast<Property *>(m_pureOutputWorkspaceProps[owp])) {
// Default name = "in1_in2_out"
const std::string inName = prop->value();
if (inName.empty())
continue;
std::string outName;
if (m_groupsHaveSimilarNames) {
outName.append(inName).append("_").append(
......@@ -1419,6 +1421,10 @@ bool Algorithm::processGroups() {
// this has to be done after execute() because a workspace must exist
// when it is added to a group
for (size_t owp = 0; owp < m_pureOutputWorkspaceProps.size(); owp++) {
Property *prop =
dynamic_cast<Property *>(m_pureOutputWorkspaceProps[owp]);
if (prop && prop->value().empty())
continue;
// And add it to the output group
outGroups[owp]->add(outputWSNames[owp]);
}
......
......@@ -322,6 +322,8 @@ Workspace_sptr PlotAsymmetryByLogValue::doLoad(size_t runNumber) {
// Load run
IAlgorithm_sptr load = createChildAlgorithm("LoadMuonNexus");
load->setPropertyValue("Filename", fn.str());
load->setPropertyValue("DetectorGroupingTable", "detGroupTable");
load->setPropertyValue("DeadTimeTable", "deadTimeTable");
load->execute();
Workspace_sptr loadedWs = load->getProperty("OutputWorkspace");
......
......@@ -123,6 +123,11 @@ void LoadNexus::runLoadMuonNexus() {
// Set the workspace property
std::string outputWorkspace = "OutputWorkspace";
loadMuonNexus->setPropertyValue(outputWorkspace, m_workspace);
loadMuonNexus->setPropertyValue("DeadTimeTable",
m_workspace + "_DeadTimeTable");
loadMuonNexus->setPropertyValue("DetectorGroupingTable",
m_workspace + "DetectorGroupingTable");
// Get the array passed in the spectrum_list, if an empty array was passed use
// the default
std::vector<int> specList = getProperty("SpectrumList");
......
......@@ -1093,6 +1093,7 @@ void SaveGSASInstrumentFile::loadFullprofResolutionFile(
}
loadfpirf->setProperty("Filename", irffilename);
loadfpirf->setProperty("OutputTableWorkspace", "outputTableWorkspace");
loadfpirf->execute();
if (!loadfpirf->isExecuted())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment