Unverified Commit 6e6427e3 authored by Jose Borreguero's avatar Jose Borreguero Committed by GitHub
Browse files

Merge pull request #32504 from mantidproject/expose_alias_method

Allow IAlgorithm.alias to be overriden in Python algorithms
parents d6d172dc 1b0b4c31
......@@ -168,8 +168,7 @@ public:
/// Function to return all of the seeAlso (these are not validated) algorithms
/// related to this algorithm.A default implementation is provided.
const std::vector<std::string> seeAlso() const override { return {}; };
/// function to return any aliases to the algorithm; A default implementation
/// is provided
/// function to return any aliases to the algorithm; A default implementation is provided
const std::string alias() const override { return ""; }
/// function to return URL for algorithm documentation; A default
......
......@@ -53,6 +53,8 @@ public:
const std::string category() const override;
/// Returns seeAlso related algorithms.
const std::vector<std::string> seeAlso() const override;
/// Allow the method returning the algorithm aliases to be overridden
const std::string alias() const override;
/// Returns optional documentation URL of the algorithm
const std::string helpURL() const override;
/// Allow the isRunning method to be overridden
......
......@@ -107,6 +107,17 @@ template <typename BaseAlgorithm> const std::vector<std::string> AlgorithmAdapte
}
}
/**
* Returns the aliases of the algorithm. If not overridden returns the base algorithm implementation
*/
template <typename BaseAlgorithm> const std::string AlgorithmAdapter<BaseAlgorithm>::alias() const {
try {
return callMethod<std::string>(getSelf(), "alias");
} catch (UndefinedAttributeError &) {
return BaseAlgorithm::alias();
}
}
/**
* Returns the summary of the algorithm. If not overridden
* it returns defaultSummary
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment