Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
6e6427e3
Unverified
Commit
6e6427e3
authored
Sep 15, 2021
by
Jose Borreguero
Committed by
GitHub
Sep 15, 2021
Browse files
Merge pull request #32504 from mantidproject/expose_alias_method
Allow IAlgorithm.alias to be overriden in Python algorithms
parents
d6d172dc
1b0b4c31
Changes
3
Hide whitespace changes
Inline
Side-by-side
Framework/API/inc/MantidAPI/Algorithm.h
View file @
6e6427e3
...
...
@@ -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
...
...
Framework/PythonInterface/mantid/api/inc/MantidPythonInterface/api/PythonAlgorithm/AlgorithmAdapter.h
View file @
6e6427e3
...
...
@@ -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
...
...
Framework/PythonInterface/mantid/api/src/PythonAlgorithm/AlgorithmAdapter.cpp
View file @
6e6427e3
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment