Import single algorithm to standalone python

Hi,
Is there any way to import a single algorithm to python?
for example if I use:
from mantid.simpleapi import LoadCIF
it will still import all algorithms, which takes quite some time.

Best Thomas

Thomas,

As Mantid can have new algorithms added at run time or added as plug ins then is dynamically determines what algorithms it has and it’s simpleapi when the simpleapi is imported. This is what takes the time, and unfortunately there is now way around this, especially as python does not inform our code which algorithm you are choosing to import.

So the line

from mantid.simpleapi import LoadCIF

Does just import the LoadCIF algorithm and not all of the others into your namespace it is no faster than importing everything, or a list of algorithms.

Regards,
Nick

This is interesting and may solve a long standing issue I’ve had - how to use a newly defined Python algorithm in a script, within MantidPlot.
It seems I can do:

import mantid
reload(mantid)
from mantid.simpleapi import MyNewAlg
MyNewAlg(InputWorkspace="w1",SomeParameter=0.3,...)

Is this guaranteed to work or was I just lucky? I find I can omit the “reload(mantid)” on the second and subsequent occasions I run the script, and in other tabs where similar scripts are run.