Skip to content

Commit

Permalink
Required and used as part of refs #4887
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed Feb 27, 2012
1 parent 49c9ff8 commit 03224f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions Code/Mantid/Framework/PythonAPI/src/api_exports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ using namespace boost::python;
class_<API::Workspace, boost::noncopyable>("Workspace", no_init)
.def("getTitle", &API::Workspace::getTitle,
return_value_policy< return_by_value >())
.def("setTitle", &API::Workspace::setTitle)
.def("getComment", &API::MatrixWorkspace::getComment,
return_value_policy< copy_const_reference >() )
.def("getMemorySize", &API::Workspace::getMemorySize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void export_Workspace()
.def("getName", &Workspace::getName, return_value_policy<copy_const_reference>(),
"Returns the name of the workspace. This could be an empty string")
.def("getTitle", &Workspace::getTitle, "Returns the title of the workspace")
.def("setTitle", &Workspace::setTitle)
.def("getComment", &Workspace::getComment, return_value_policy<copy_const_reference>(), "Returns the comment field on the workspace")
.def("isDirty", &Workspace::isDirty, Workspace_isDirtyOverloads(args("n"), "True if the workspace has run more than n algorithms (Default=1)"))
.def("getMemorySize", &Workspace::getMemorySize, "Returns the memory footprint of the workspace in KB")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,14 @@ def test_history_access(self):
self.assertEquals(first.getPropertyValue("OutputWorkspace"), "raw")
ads.remove('raw')

def test_setTitle(self):
run_algorithm('CreateWorkspace', OutputWorkspace='ws1',DataX=[1.,2.,3.], DataY=[2.,3.], DataE=[2.,3.],UnitX='TOF')
ads = AnalysisDataService.Instance()
ws1 = ads['ws1']
title = 'test_title'
ws1.setTitle(title)
self.assertEquals(title, ws1.getTitle())

if __name__ == '__main__':
unittest.main()

0 comments on commit 03224f4

Please sign in to comment.