-
Notifications
You must be signed in to change notification settings - Fork 128
Remove (most of) the code intended for python 2 #38048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
005c977
remove code intended for python 2
jhaigh0 cafd312
update simpleapi to use Signature objects
jhaigh0 3e8a9f4
Explicitly include boost header
jhaigh0 29428ba
Merge branch 'main' into remove_python_2
jhaigh0 36656b4
use f-string instead of .format
jhaigh0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,11 +41,9 @@ | |
from mantid import api as _api, kernel as _kernel | ||
from mantid import apiVersion # noqa: F401 | ||
from mantid.kernel import plugins as _plugin_helper | ||
from mantid.kernel import ConfigService, logger | ||
from mantid.kernel.funcinspect import ( | ||
customise_func as _customise_func, | ||
lhs_info as _lhs_info, | ||
replace_signature as _replace_signature, | ||
LazyFunctionSignature, | ||
) | ||
|
||
|
@@ -321,7 +319,7 @@ def wrapper(*args, **kwargs): | |
|
||
# end | ||
function_name = f.__name__ | ||
signature = ("\bFunction, InputWorkspace", "**kwargs") | ||
signature = LazyFunctionSignature(alg_name=function_name, include_self=False) | ||
fwrapper = _customise_func(wrapper, function_name, signature, f.__doc__) | ||
if function_name not in __SPECIALIZED_FUNCTIONS__: | ||
__SPECIALIZED_FUNCTIONS__.append(function_name) | ||
|
@@ -527,7 +525,7 @@ def CutMD(*args, **kwargs): # noqa: C901 | |
return out_names[0] | ||
|
||
|
||
_replace_signature(CutMD, ("\bInputWorkspace", "**kwargs")) | ||
CutMD.__signature__ = LazyFunctionSignature(alg_name="CutMD", include_self=False) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know why some algorithms need special treatment? E.g. |
||
|
||
|
||
def RenameWorkspace(*args, **kwargs): | ||
|
@@ -572,7 +570,7 @@ def RenameWorkspace(*args, **kwargs): | |
return _gather_returns("RenameWorkspace", lhs, algm) | ||
|
||
|
||
_replace_signature(RenameWorkspace, ("\bInputWorkspace,[OutputWorkspace],[True||False]", "**kwargs")) | ||
RenameWorkspace.__signature__ = LazyFunctionSignature(alg_name="RenameWorkspace", include_self=False) | ||
|
||
|
||
def _get_function_spec(func): | ||
|
@@ -1179,23 +1177,6 @@ def get_self(frame_arg): | |
# ---------------------------------------------------------------------------------------------------------------------- | ||
|
||
|
||
def _create_fake_function(name): | ||
"""Create fake functions for the given name""" | ||
|
||
# ------------------------------------------------------------------------------------------------ | ||
def fake_function(*args, **kwargs): | ||
raise RuntimeError( | ||
"Mantid import error. The mock simple API functions have not been replaced!" | ||
" This is an error in the core setup logic of the mantid module, " | ||
"please contact the development team." | ||
) | ||
|
||
# ------------------------------------------------------------------------------------------------ | ||
fake_function.__name__ = name | ||
_replace_signature(fake_function, ("", "")) | ||
globals()[name] = fake_function | ||
|
||
|
||
def _mockup(plugins): | ||
""" | ||
Creates fake, error-raising functions for any plugins given. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.