How do I write a Python algorithm that takes a list of workspaces as input (like GroupWorkspaces does)? I could use a list of strings but that doesn’t do any validation that the workspaces exist (or are of an appropriate type, if required).
GroupWorkspaces does actually just accept a list of strings, but it uses a specific validator that knows that this is a list of workspaces, and ensures that they all exist.
The validator also is detected by the automatically generated algorithm dialog which then uses a list box rather than a text box.
The validator is called the ADSValidator and it is in mantid.api. I’ll add another post with an example.
Ok I’ve tried for a while, but this is the first time the ADSValiadtor was to be used in Python. Most of it is exposed, but there seems to be some issues that is stopping it working, I’ve created an issue for this. While the fix will no doubt be simple, finding where to fix it may be quite difficult.
Thanks for trying. Hopefully it’s an easy fix.
Making Mantid give useful traceback instead of that “UNKNOWN exception in initialize()” box might help - I get that and have to inspect my script carefully to work out where I’ve mis-spelled something.