-
Notifications
You must be signed in to change notification settings - Fork 128
storeInADS preserved in algorithm history and recreated correctly by script builder #37839
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
storeInADS preserved in algorithm history and recreated correctly by script builder #37839
Conversation
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.
I've tested this using StoreInADS=True and StoreInADS=False, and without StoreInADS. In all cases the generated python scripts execute as expected! I've also tried with StoreInADS=False and then assigning the output workspace to a new variable - it still seems to work well, so good job!
I just had a few picky suggestions, feel free to ignore!
Co-authored-by: Rob Applin <40830825+robertapplin@users.noreply.github.com>
pre-commit.ci run |
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.
Thanks for the changes! This works well and the code additions look good, so happy to approve
no longer needed since the work in #37839
Description of work
Previously, scripts in the form
would be recreated via the ScriptBuilder as
which would not run as
'__TMP_<uid>'
is not a workspace in the ADS.This PR aims to change this behaviour, so workspace histories can be recreated accurately.
Summary of work
AlgorithmHistory
now tracks whetherStoreInADS
was set to false.ScriptBuilder
will recreate assignment statements (ws = Algorithm(..)
), add inStoreInADS=False
when needed, and pass in workspace variables instead of strings.PropertyHistory
will sotre if the property should be treated as python variable rather than a string.Fixes #33252
To test:
I have been testing with this script.
then right clicking
result
in the ADS -> Show History -> Copy to Clipboard and running the coppied script to check it works.This could probably do with more complex testing though; I'm sure there will be edge cases where it doesn't quite work (reassigning python variable to a new name perhaps?) but my hope is not of these cases would have worked before either.
This is definitely a PR looking for feedback, if we should change the workspace history widget to reflect when workspaces aren't stored in the ADS for example.
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.