Skip to content

Add MONTHS_PER_YEAR constant and use it in cplhist_monthly_clim - #4310

Open
michellejtan wants to merge 3 commits into
ESCOMP:b4b-devfrom
michellejtan:constants-module
Open

michellejtan wants to merge 3 commits into
ESCOMP:b4b-devfrom
michellejtan:constants-module

single_point_case: use constants in a docstring and the --dompft error

0ce1e7b
Select commit
Loading
Failed to load commit list.
Task list completed / task-list-completed Started 2026-11-09 22:46:16 ago

10 / 11 tasks completed

1 task still to be completed

Details

Required Tasks

Task Status
Two new tests fail before the change and pass after: test_unit_constants.py (ImportError before constants.py existed) and test_check_dom_pft_message_lower_bound ("...between 0 and" does not match "...between 1 and 78." before the fix). Completed
A third new test, test_noleapDaysMatchMonthsPerYear, checks that NOLEAP_DAYS and year_months() have MONTHS_PER_YEAR entries. It passes before and after; it guards against drift. Completed
Python unit tests, from python/: ./run_ctsm_py_tests -u in the ctsm_pylib conda environment: 680 passed (677 passed on b4b-dev before my changes, plus my 3). Completed
make -C python black: 182 files left unchanged. make -C python lint: 10.00/10. Completed
Python system tests: not run. The CI python-tests workflow runs only the unit tests, and when I tried test_sys_aero_1850_monthly_clim.py (the one that exercises cplhist_monthly_clim) all 5 tests were skipped because NCO (ncra, ncrcat, ncatted) is not installed on my machine. Incomplete
Was AI used in this contribution? Yes Completed
I have followed the CTSM contribution guidelines. Completed
The code in this PR branch runs with no errors. Briefly describe tested configuration(s): the python unit tests (680 pass), black and pylint, in the ctsm_pylib conda environment on Ubuntu (WSL2), Python 3.13.13. Completed
This either (a) does not change answers, (b) it only changes answers at roundoff level, or (c) I have performed a scientific evaluation of the answer changes. Which?: (a) Completed
I have reviewed relevant parts of the CLM documentation Tech Note or User's Guide to determine if anything needs to be changed or added. If it does, describe: I searched doc/ for the old error text and for --dompft; the single-point user guide mentions --dompft but not its range or the error message, and the Tech Note has no mention of these tools, so nothing needs to change. Completed
This PR either (a) does not create a need to update the documentation or (b) includes required documentation updates (see guidelines for contributing documentation). Which?: (a) Completed