In payu checkout - initialise laboratory directories before generating any metadata. This will fail with PermissionError if directories are non-writable, and prints some information on how to recover
Fix a small error with changing archive symlinks when a previous directory has been deleted - added test
Fix a uncaught warning when running payu checkout pytests
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 to payu clone/checkout. It doesn't modify the config.yaml so will either need to be passed to subsequent payu commands or shortpath/laboratory/project options will need to modified manually in config.yaml.
I initialised laboratory directories (using mkdir_p) rather just checking for write access using os.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 call laboratory.initialize() in Experiment() as when running payu setup/sweep/run it would be good to know first thing if the laboratory directory is even writable.
coverage: 58.517% (+0.2%) from 58.29%
when pulling ba95e0148d79b274a85ae7d802b06fbaa8c8fb8a on ACCESS-NRI:524-Checkout-project-error-bug
into 1186c46e47866468f4e56ed74a578d83ffcee0e0 on payu-org:master.
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