-
Notifications
You must be signed in to change notification settings - Fork 124
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
Remove (most of) the code intended for python 2 #38048
Conversation
c4ed2bd
to
0a6fc7c
Compare
12a66c4
to
dcbff1f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple of minor points. I also fired up Workbench (no errors or warnings) and tried a couple of the algorithms that have changes, worked fine, as far as I could tell.
With the changes to simpleapi
might be worth considering a package build.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why some algorithms need special treatment? E.g. CutMD
and RenameWorkspace
Framework/PythonInterface/mantid/api/src/Exports/SpectrumInfoPythonIterator.cpp
Show resolved
Hide resolved
Co-authored-by: James Clarke <139879523+jclarkeSTFC@users.noreply.github.com>
2d9f3dd
to
3e8a9f4
Compare
👋 Hi, @jhaigh0, Conflicts have been detected against the base branch. Please rebase your branch against the base branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just a couple of comments
Co-authored-by: thomashampson <thomas.hampson@stfc.ac.uk>
Description of work
Remove code which is taking precautions wrt python 2. Release 4.2.0 was the final release to support python 2, so I think there's little risk in doing this.
Also updated how
simpleapi.py
was handling function signatures as part of this.I've only searched for code by looking for comments mentioning python 2 so I'm sure there are more places out there.
There are a couple of cpp boost instances which look like they could be changed, but this is supposed to be a quick maintenance task and they look like they'd be more complex problems. Let me know if you disagree.
https://github.com/mantidproject/mantid/blob/main/Framework/PythonInterface/core/inc/MantidPythonInterface/core/PythonObjectInstantiator.h#L80-L87
https://github.com/mantidproject/mantid/blob/main/Framework/PythonInterface/mantid/kernel/src/Registry/PropertyWithValueFactory.cpp#L54-L61
There are some comments
implement with ContextDecorator after python2 is deprecated)
which have been deleted. They are currently using@contextmanager
which is based onContextDecorator
anywayThere is no associated issue.
To test:
This does not require release notes because no user impact
Reviewer
Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.
Code Review
Functional Tests
Does everything look good? Mark the review as Approve. A member of
@mantidproject/gatekeepers
will take care of it.Gatekeeper
If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.