Skip to content

Fix POP namelist typos in CAM-ECT setup - #436

Closed
monsterlag wants to merge 1 commit into
ESCOMP:cesm3.0-alphabranchfrom
monsterlag:fix/issue-213-483c
Closed

monsterlag wants to merge 1 commit into
ESCOMP:cesm3.0-alphabranchfrom
monsterlag:fix/issue-213-483c

Conversation

@monsterlag

Copy link
Copy Markdown

Note

AI-generated, not reviewed by a human. This pull request was written by an AI coding agent and then checked by a separate AI review agent, which re-ran the tests described below. No human has reviewed the code. It is submitted by @monsterlag, who runs these agents. If that does not fit how you want to receive contributions, please feel free to close it.

Description of changes

CAM-ECT case setup aborts with a NameError when user_nl_pop exists because it calls test.append instead of text.append. The same block also inserts a stray apostrophe before n_tavg_streams, producing an invalid POP namelist.

Correct both typos without changing the intended namelist settings. Add isolated regression tests for annual and ultra-fast CAM-ECT setup, preservation of existing POP namelist content, and cases without user_nl_pop.

Specific notes

Contributors other than yourself, if any: None.

Fixes: #213 — typos in tools/statistical_ensemble_test/single_run.py and its generated POP namelist.

User interface changes?: No.

Testing performed (automated tests and/or manual tests):

  • python3 -B -m unittest discover -s tools/statistical_ensemble_test/tests -p 'test_*.py' -v — 3 tests pass. Before the fix, the two tests with a POP namelist errored with NameError. Correcting only that typo in memory exposed the stray apostrophe as two assertion failures.
  • python3 -B -W error -m unittest discover -s tools/statistical_ensemble_test/tests -p 'test_*.py' -v — 3 tests pass with warnings treated as errors.
  • Python syntax compilation of both changed files and git diff --check pass.

The tests use temporary case files and mock external shell commands. CESM compilation, model runs, and the real CIME preview_namelists were not run. No lint or typecheck command is configured for this utility.

Use text.append for tavg_freq_opt and remove the stray quote before
n_tavg_streams. Add isolated tests for annual and ultra-fast CAM case
setup, including cases without a POP namelist.

Testing: python3 -B -m unittest discover -s
tools/statistical_ensemble_test/tests -p 'test_*.py' -v (3 tests pass).
@billsacks

Copy link
Copy Markdown
Member

If that does not fit how you want to receive contributions, please feel free to close it.

This does not fit with how we want to receive contributions.

@billsacks billsacks closed this Oct 22, 2026
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 this pull request may close these issues.

Typo in statistical_ensemble_test/single_run.py

2 participants