payu-org / payu

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

Get module executables from path loaded by environment modules #439

Closed jo-basevi closed 6 months ago

jo-basevi commented 6 months ago

Modules are still loaded the same way in experiment.run so to not change users env vars when running payu setup

Closes #379

pep8speaks commented 6 months ago

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! :beers:

Comment last updated at 2024-05-14 05:21:31 UTC
jo-basevi commented 6 months ago

Hi Aidan, thanks for the review! I've changed the logic a little bit to actually load user modules as part of payu setup rather than payu run(other modules will still get loaded in payu run).

The idea was to actually check if the module will be found, and check if more than one module is available. It errors out if more than one module is available - this may be a breaking change for configs thats haven't added a version for modules? I am not sure if there exists a case when the same module and version exists in two modulepaths, but still want one of them to be loaded? If so, can change it to an warning..

I wanted to also load the actual modules that will be loaded as part of payu run. There could be a confusing case where one modulefile was loaded because module use was used, but that was different to the module loaded only using module: use: in config.yaml`. Hopefully this case be caught with the above check.