payu-org / payu

A workflow management tool for numerical models on the NCI computing systems
Apache License 2.0
18 stars 25 forks source link

Initialise Laboratory inside `payu clone` #428

Open jo-basevi opened 3 months ago

jo-basevi commented 3 months ago

As payu clone creates metadata files in archive, it initialises an Laboratory object but does not run Laboratory.initialize() which is run as part of payu init. This issue is for checking whether Laboratory.initialize() should be added to the clone method, so payu init is not required to be run. If so, it will be a one-line change.

aidanheerdegen commented 2 months ago

I just tested this

payu clone -b expt -B release-1deg_jra55_ryf https://github.com/ACCESS-NRI/access-om2-configs.git 1deg_jra55_ryf

in a project without an existing laboratory, i.e. /scratch/lg87/aph502/access-om2 didn't exist.

After running above

$ ls -g /scratch/lg87/aph502/access-om2/archive/
total 4
drwxr-s--- 2 lg87 4096 Apr 12 12:23 1deg_jra55_ryf-expt-590c9286

So payu is creating what it needs (archive). I then ran payu setup and it made the work directory and subdirectory

$ ls -g /scratch/lg87/aph502/access-om2/
total 8
drwxr-s--- 3 lg87 4096 Apr 12 12:23 archive
drwxr-s--- 3 lg87 4096 Apr 12 12:26 work

Arguably with the standard configs not really using the laboratory input and bin directories this is actually a little cleaner as it doesn't create directories it doesn't use.