ESMCI / ESMCI/cime

CIME usability problems when using it as a library

Open
#3,393 14 comments 2 reactions 1 assignee Claimed by @jasonb5 View on GitHub
Low Priority tp: CIMElib ty: Discussion
Dominant language
Python
Stars
174
Forks
225
Avg merge
1d 16h
Merged PRs (30d)
14

Description

I've long thought that it would be nice to be able to interact with CIME via python, as a library, in addition to the current CLI. It turns out, I'm not the only one and I received indicators of interest for this capability from others in E3SM.

For example, a user should be able to do this:
```python
from CIME.case import Case
import CIME.build as build

caseroot = path_to_case_dir
with Case(caseroot, read_only=False) as case:
case.create(create_args)
case.case_setup(setup_args)
build.case_build(build_args)
case.submit(submit_args)
```

This works in theory, but in practice it's quite difficult. The main problem is that case.create takes a ton of arguments and, unlike the CLI which populates fields with reasonable defaults, the defaults to the create function are must less usable.

We should strive to make the defaults for all main CIME entry points be identical regardless of CLI vs. library use (and do this without duplication).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.