Ticket #4915 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

Python algorithms: declare a generic "Workspace" property

Reported by: Janik Zikovsky Owned by: Martyn Gigg
Priority: major Milestone: Release 2.1
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Stuart Campbell

Description

For the RunScriptCode algorithm, I need to be able to declare an InputWorkspace property to be of a generic "Workspace" (not MatrixWorkspace" type) so that it can handle IMDWorkspace, MatrixWorkspace, or WorkspaceGroup, or other types as needed. Currently, it only seems to be possible to say TableWorkspace or MatrixWorkspace.

Change History

comment:1 Changed 9 years ago by Martyn Gigg

  • Status changed from new to accepted

Yes this was another one of the many shortcomings of the old API.

I'll backport stuff so that a generic WorkspaceProperty<Workspace> is usable in Python, it's won't be the prettiest in the old API though.

comment:2 Changed 9 years ago by Martyn Gigg

Refs #4915. Allow generic WorkspaceProperty type in Python algs

This is all much cleaner in the new API.

Changeset: cc4ab28d611dd7b64732045c767832573b76fdfd

comment:3 Changed 9 years ago by Martyn Gigg

That should do what you need, Janik. Let me know if something is missing.

comment:4 Changed 9 years ago by Janik Zikovsky

Refs #4915 pythonAlgorithm setProperty() works for generic workspace

Changeset: 1f280812a8a7c49862ae01db9a1c454052e46256

comment:5 Changed 9 years ago by Janik Zikovsky

Refs #4873 use generic Workspace properties in RunPythonScript

Refs #4915

Changeset: f67230feca6f1403e2f83cfa35ca1e4ef6039ca8

comment:6 Changed 9 years ago by Janik Zikovsky

  • Status changed from accepted to verify
  • Resolution set to fixed

Thanks Martyn, with the little extra change above the generic Workspace property works for me.

comment:7 Changed 9 years ago by Martyn Gigg

Refs #4915. Allow generic WorkspaceProperty type in Python algs

This is all much cleaner in the new API.

Changeset: cc4ab28d611dd7b64732045c767832573b76fdfd

comment:8 Changed 9 years ago by Janik Zikovsky

Refs #4915 pythonAlgorithm setProperty() works for generic workspace

Changeset: 1f280812a8a7c49862ae01db9a1c454052e46256

comment:9 Changed 9 years ago by Janik Zikovsky

Refs #4873 use generic Workspace properties in RunPythonScript

Refs #4915

Changeset: f67230feca6f1403e2f83cfa35ca1e4ef6039ca8

comment:10 Changed 8 years ago by Stuart Campbell

  • Status changed from verify to verifying
  • Tester set to Stuart Campbell

comment:11 Changed 8 years ago by Stuart Campbell

  • Status changed from verifying to closed

I can indeed pass any type of workspace into the RunPythonScript algorithm.

comment:12 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 5761

Note: See TracTickets for help on using tickets.