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

Support symbolic links to configuration files #450

Open aidanheerdegen opened 1 week ago

aidanheerdegen commented 1 week ago

For ACCESS models it would be convenient to have a number of possible pre-set diagnostic output profiles and use symbolic links to select the desired output profile.

Currently this is not supported correctly with payu. Configuration files are copied into the work directory here

https://github.com/payu-org/payu/blob/master/payu/models/model.py#L234

and

https://github.com/payu-org/payu/blob/master/payu/models/model.py#L239

According to the documentation of the shutil.copy function this will copy a symbolic link rather than the file it points to.

This is undesirable behaviour for payu: if it is a symbolic link we want a copy of the file in work. This can be achieved by adding the follow_symlinks=True option to the copy command.