-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add error handling for payu checkout with non-writable laboratory #528
Add error handling for payu checkout with non-writable laboratory #528
Conversation
…s writable Checking base labdirectory for just write access fails for laboratory directories that don't exist yet.
Hello @jo-basevi! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2024-10-14 04:07:28 UTC |
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! LGTM, just a tiny suggestion, feel free to disagree/ignore.
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.
LGTM
This PR:
I was running with the idea of checking out a git branch - running checks on that branch and then if they failed, reverting the checkout back to the previous branch (and delete any new branches that were created). Though I then finally realised that it would make it difficult for the user to apply fixes on the branch/tag/commit they were starting from, e.g. fix project/shortpath/laboratory in config.yaml. It would require adding command-line args to payu clone/checkout that will require modifications to config.yaml.
There is the pre-existing
--laboratory
command-line flag topayu clone/checkout
. It doesn't modify theconfig.yaml
so will either need to be passed to subsequentpayu
commands orshortpath/laboratory/project
options will need to modified manually inconfig.yaml
.I initialised laboratory directories (using
mkdir_p
) rather just checking for write access usingos.access
, so it wouldn't fail when a laboratory base directory does not exist but it can be created by a user. I added laboratory specific error messaging to Laboratory class method, and also calllaboratory.initialize()
inExperiment()
as when runningpayu setup/sweep/run
it would be good to know first thing if the laboratory directory is even writable.Closes #524