Expected behavior
I can select a directory containing useful user written algorithms and fit functions, and the files in it are run on starting Mantid Workbench, making the algorithms and fit functions available for use
As an aside if one of these scripts has an error it would be good to be notified, especially if following files or directories are not processed.
Actual behavior
Mantid Workbench doesn’t seem to do anything with the directories in Manage User Directories → Python Script Directories.
Steps to reproduce the behavior
Go into Manage User Directories, add a directory with some Python scripts in it which define algorithms. Exit and restart Workbench.
Platforms affected
Workbench. (This has worked OK in Mantid Plot for ages)
Funnily enough Workbench and Plot actually have the same functionality for loading scripts upon launch.
You need to set the path for Mantid to look for, in the MantidInstall/bin/mantid.user.properties file, setting the path such as:
user.python.plugins.directories=C:/MantidInstall/Scriptrepo/muon
BUT, the easiest way to do this is to open up the MantidPlot related to the Workbench you are using. (ie both 4.2 or both the Nightly) and navigate to View/PreferencesMenu/Mantid/DirectoriesTab and set the Python Extensions to the folder with the scripts you’d like to run on launch.
Hopefully a failing script here won’t crash Workbench on launch, but it would be one of the first things I’d think to check!
This works, thanks!
So what if anything is the “scripts” category for? And is there a ticket to add “edit the Python Extensions list” to Workbench? The Workbench UI with one directory per line (for data search and scripts) is much nicer than the Mantid Plot one where it’s all in one line with horizontal scrolling.
I checked a script with a deliberate error and I get a helpful traceback in the messages pane once Workbench is open.
We are planning to move over more of the settings functionality such as this option to Workbench. I’ll include this feedback in our group meeting today!
I’m glad that Workbench still loads correctly even if the script doesn’t run successfully!