Ticket #11121 (assigned)

Opened 6 years ago

Last modified 5 years ago

Accept non-ADS workspaces in python simpleapi

Reported by: Harry Jeffery Owned by: Martyn Gigg
Priority: major Milestone: Release 3.5
Component: Python Keywords: CORE
Cc: Blocked By:
Blocking: Tester:

Description

If a workspace is not in the ads, it cannot be given to an algorithm using the simple api. The original reason for this seems to have been resolved by ticket #5157.

Let's see if this restriction can now be lifted.

Change History

comment:1 Changed 6 years ago by Harry Jeffery

  • Status changed from new to assigned

comment:2 Changed 6 years ago by Harry Jeffery

  • Status changed from assigned to inprogress

comment:3 Changed 6 years ago by Harry Jeffery

  • Status changed from inprogress to assigned

After applying this patch:

diff --git a/Code/Mantid/Framework/PythonInterface/mantid/simpleapi.py b/Code/Mantid/Framework/PythonInterface/mantid/simpleapi.py
index c85f036..bf0c7c6 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/simpleapi.py
+++ b/Code/Mantid/Framework/PythonInterface/mantid/simpleapi.py
@@ -518,18 +518,15 @@ def _set_properties(alg_object, *args, **kwargs):
     # Set the properties of the algorithm.
     for key in kwargs.keys():
         value = kwargs[key]
         if value is None:
             continue
-        # The correct parent/child relationship is not quite set up yet: #5157
-        # ChildAlgorithms in Python are marked as children but their output is in the
-        # ADS meaning we cannot just set DataItem properties by value. At the moment
-        # they are just set with strings
+
         if isinstance(value, _kernel.DataItem):
             alg_object.setPropertyValue(key, value.name())
-        else:
-            alg_object.setProperty(key, value)
+
+        alg_object.setProperty(key, value)
 
 def _create_algorithm_function(algorithm, version, _algm_object):
     """
         Create a function that will set up and execute an algorithm.
         The help that will be displayed is that of the most recent version.

the following tests failed:

PythonAlgorithms_MolDynTest
PythonAlgorithms_VesuvioResolutionTest

At least in the Vesuvio case, the failure seems to stem from calling setPropertyValue and then setProperty.

Handing over to Martyn for further analysis.

comment:4 Changed 6 years ago by Harry Jeffery

  • Owner changed from Harry Jeffery to Martyn Gigg

comment:5 Changed 6 years ago by Martyn Gigg

  • Milestone changed from Release 3.4 to Release 3.5

comment:6 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 11960

Note: See TracTickets for help on using tickets.