Skip to content

Commit

Permalink
test pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Aug 21, 2024
1 parent d489e1c commit 49a0f39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions CIME/SystemTests/restart_tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""
Abstract class for restart tests
"""

from CIME.SystemTests.system_tests_compare_two import SystemTestsCompareTwo
Expand Down Expand Up @@ -35,7 +34,7 @@ def _case_one_setup(self):
stop_n = self._case1.get_value("STOP_N")
expect(stop_n >= 3, "STOP_N must be at least 3, STOP_N = {}".format(stop_n))
self._set_restart_interval()

def _case_two_setup(self):
rest_n = self._case1.get_value("REST_N")
stop_n = self._case1.get_value("STOP_N")
Expand Down
11 changes: 5 additions & 6 deletions CIME/SystemTests/system_tests_common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Base class for CIME system tests
"""

from CIME.XML.standard_module_setup import *
from CIME.XML.env_run import EnvRun
from CIME.XML.env_test import EnvTest
Expand Down Expand Up @@ -118,7 +119,7 @@ def __init__(
self._user_separate_builds = False
self._expected_num_cmp = None
self._rest_n = None

def _set_restart_interval(self):
stop_n = self._case.get_value("STOP_N")
stop_option = self._case.get_value("STOP_OPTION")
Expand All @@ -127,7 +128,6 @@ def _set_restart_interval(self):
# value that makes sense for all components
maxncpl = 10000
minncpl = 0
maxcomp = None
for comp in self._case.get_values("COMP_CLASSES"):
if comp == "CPL":
continue
Expand All @@ -141,7 +141,6 @@ def _set_restart_interval(self):

if ncpl and maxncpl > ncpl:
maxncpl = ncpl
maxcomp = comp
if ncpl and minncpl < ncpl:
minncpl = ncpl

Expand Down Expand Up @@ -175,8 +174,8 @@ def _set_restart_interval(self):
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)
rest_n = int((stop_n // 2 + 1) * coupling_secs / factor)

expect(stop_n > 0, "Bad STOP_N: {:d}".format(stop_n))

expect(stop_n > 2, "ERROR: stop_n value {:d} too short".format(stop_n))
Expand All @@ -187,7 +186,7 @@ def _set_restart_interval(self):
)
self._case.set_value("REST_N", rest_n)
return rest_n

def _init_environment(self, caseroot):
"""
Do initializations of environment variables that are needed in __init__
Expand Down

0 comments on commit 49a0f39

Please sign in to comment.