From 391a1885a7d634b80ea5a629cb79bd5676e1f0ff Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 28 Aug 2024 15:49:27 -0600 Subject: [PATCH 1/4] fix the restart tests by using ceil instead of int --- CIME/SystemTests/system_tests_common.py | 6 +++--- CIME/non_py/cprnc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CIME/SystemTests/system_tests_common.py b/CIME/SystemTests/system_tests_common.py index 3c1f3e99830..08a0be6b1c7 100644 --- a/CIME/SystemTests/system_tests_common.py +++ b/CIME/SystemTests/system_tests_common.py @@ -38,7 +38,7 @@ ) import CIME.build as build -import glob, gzip, time, traceback, os +import glob, gzip, time, traceback, os, math from contextlib import ExitStack logger = logging.getLogger(__name__) @@ -173,8 +173,8 @@ def _set_restart_interval(self): else: expect(False, f"stop_option {stop_option} not available for this test") - stop_n = int(stop_n * factor // coupling_secs) - rest_n = int((stop_n // 2 + 1) * coupling_secs / factor) + stop_n = math.ceil(stop_n * factor // coupling_secs) + rest_n = math.ceil((stop_n // 2 + 1) * coupling_secs / factor) expect(stop_n > 0, "Bad STOP_N: {:d}".format(stop_n)) diff --git a/CIME/non_py/cprnc b/CIME/non_py/cprnc index e3eaa5346ec..9276b219750 160000 --- a/CIME/non_py/cprnc +++ b/CIME/non_py/cprnc @@ -1 +1 @@ -Subproject commit e3eaa5346ecd50aef8b60fdf54b98cb1c13a24b1 +Subproject commit 9276b219750881633d8673c72ec80ac821f96d82 From b0bf7f02d8cb0753535836b104b53b570ab0d0de Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 28 Aug 2024 16:01:37 -0600 Subject: [PATCH 2/4] no ceil needed for stop_n --- CIME/SystemTests/system_tests_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CIME/SystemTests/system_tests_common.py b/CIME/SystemTests/system_tests_common.py index 08a0be6b1c7..7295ea67ca1 100644 --- a/CIME/SystemTests/system_tests_common.py +++ b/CIME/SystemTests/system_tests_common.py @@ -173,7 +173,7 @@ def _set_restart_interval(self): else: expect(False, f"stop_option {stop_option} not available for this test") - stop_n = math.ceil(stop_n * factor // coupling_secs) + stop_n = stop_n * factor // coupling_secs rest_n = math.ceil((stop_n // 2 + 1) * coupling_secs / factor) expect(stop_n > 0, "Bad STOP_N: {:d}".format(stop_n)) From adc832719636e099281ff7d9c971fcf0e8d98a72 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Thu, 29 Aug 2024 07:39:38 -0600 Subject: [PATCH 3/4] update pre-commit --- CIME/code_checker.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CIME/code_checker.py b/CIME/code_checker.py index 4c05f22e477..fdc1eedefd8 100644 --- a/CIME/code_checker.py +++ b/CIME/code_checker.py @@ -45,11 +45,14 @@ def _run_pylint(all_files, interactive): # cmd_options +=",relative-import" # add init-hook option - cmd_options += ' --init-hook=\'import sys; sys.path.extend(("%s","%s","%s","%s"))\'' % ( - os.path.join(cimeroot, "CIME"), - os.path.join(cimeroot, "CIME", "Tools"), - os.path.join(cimeroot, "scripts", "fortran_unit_testing", "python"), - os.path.join(srcroot, "components", "cmeps", "cime_config", "runseq"), + cmd_options += ( + ' --init-hook=\'import sys; sys.path.extend(("%s","%s","%s","%s"))\'' + % ( + os.path.join(cimeroot, "CIME"), + os.path.join(cimeroot, "CIME", "Tools"), + os.path.join(cimeroot, "scripts", "fortran_unit_testing", "python"), + os.path.join(srcroot, "components", "cmeps", "cime_config", "runseq"), + ) ) files = " ".join(all_files) From c53f13c16479760dbdb232e69654063614a64e49 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Thu, 29 Aug 2024 09:43:14 -0600 Subject: [PATCH 4/4] resolve cprnc diff --- CIME/non_py/cprnc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CIME/non_py/cprnc b/CIME/non_py/cprnc index 9276b219750..e3eaa5346ec 160000 --- a/CIME/non_py/cprnc +++ b/CIME/non_py/cprnc @@ -1 +1 @@ -Subproject commit 9276b219750881633d8673c72ec80ac821f96d82 +Subproject commit e3eaa5346ecd50aef8b60fdf54b98cb1c13a24b1