Skip to content
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

Updated required libs functionality breaks with solo models #354

Closed
aidanheerdegen opened this issue Aug 8, 2023 · 1 comment · Fixed by #356
Closed

Updated required libs functionality breaks with solo models #354

aidanheerdegen opened this issue Aug 8, 2023 · 1 comment · Fixed by #356
Assignees

Comments

@aidanheerdegen
Copy link
Collaborator

Solo models break with functionality introduced in #351 because their config is never populated with required_libs.

The error looks like this

Traceback (most recent call last):
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-23.04/bin/payu-run", line 10, in <module>
    sys.exit(runscript())
  File "/g/data/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/payu/subcommands/run_cmd.py", line 132, in runscript
    expt.run()
  File "/g/data/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/payu/experiment.py", line 525, in run
    envmod.lib_update(
  File "/g/data/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/payu/envmod.py", line 101, in lib_update
    for lib_filename, lib_path in required_libs.items():
AttributeError: 'NoneType' object has no attribute 'items'

and occurs for configs with a single solo model, like MOM6-CICE6.

Each of the sub-models config has the correct information injected here:

https://github.com/payu-org/payu/blob/master/payu/experiment.py#L143

but this not done if there is a solo model.

@aidanheerdegen
Copy link
Collaborator Author

First step is to create a test that reproduces this error. That isn't super straightforward, as there are no existing tests of payu.experiment.run, but it should be possible to instantiate a solo Model and assert that model.required_libs exists and is a dict.

Populating the required_libs should probably be moved to payu.models.model.setup, and payu.models.model.required_libs should be initialised to an empty dict in payu.models.model.init, somewhere here:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants