Skip to content

Commit

Permalink
make hidden a logical
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Sep 10, 2024
1 parent 47ea873 commit ad8d32f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
8 changes: 7 additions & 1 deletion CIME/XML/env_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,13 @@ def make_batch_script(self, input_template, job, case, outfile=None):
overrides=overrides,
)
env_workflow = case.get_env("workflow")
self._hidden_batch_script[job] = env_workflow.get_value("hidden", subgroup=job)

hidden = env_workflow.get_value("hidden", subgroup=job)
if hidden is None or hidden == "True" or hidden == "true":
self._hidden_batch_script[job] = True
else:
self._hidden_batch_script[job] = False

output_name = (
get_batch_script_for_job(
job,
Expand Down
2 changes: 1 addition & 1 deletion CIME/data/config/xml_schemas/config_workflow.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<!-- simple elements -->
<xs:element name="template" type="xs:anyURI"/>
<xs:element name="hidden" type="xs:string" default="True"/>
<xs:element name="hidden" type="xs:string"/>
<xs:element name="task_count" type="xs:string"/>
<xs:element name="tasks_per_node" type="xs:string"/>
<xs:element name="walltime" type="xs:string"/>
Expand Down
2 changes: 1 addition & 1 deletion CIME/tests/test_sys_create_newcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_a_createnewcase(self):
# on systems (like github workflow) that do not have batch, set this for the next test
if batch_system == "none":
self.run_cmd_assert_result(
'./xmlchange --subgroup case.run BATCH_COMMAND_FLAGS="-q \$JOB_QUEUE"',
r'./xmlchange --subgroup case.run BATCH_COMMAND_FLAGS="-q \$JOB_QUEUE"',
from_dir=testdir,
)

Expand Down
8 changes: 4 additions & 4 deletions CIME/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2530,11 +2530,11 @@ def run_bld_cmd_ensure_logging(cmd, arg_logger, from_dir=None, timeout=None):
expect(stat == 0, filter_unicode(errput))


def get_batch_script_for_job(job, hidden="True"):
def get_batch_script_for_job(job, hidden=None):
# this if statement is for backward compatibility
if job == "case.st_archive" and not hidden:
hidden = "False"
return "." + job if not hidden or hidden == "True" else job
if hidden is None:
hidden = job != "case.st_archive"
return "." + job if hidden else job


def string_in_list(_string, _list):
Expand Down

0 comments on commit ad8d32f

Please sign in to comment.