Skip to content

Commit

Permalink
consolidate info_mode 3 multi-support-var assessment to single status
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyB9000 committed Jul 24, 2023
1 parent 530ea14 commit 093800c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions e3sm_to_cmip/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,12 +714,17 @@ def _run_info_mode(self): # noqa: C901
raw_vars = []
raw_vars.extend(handler["raw_variables"])

allpass = True
for raw_var in raw_vars:
if raw_var in ds.data_vars:
stat_msg = f"Table={handler['table']}:Variable={handler['name']}:DataSupport=TRUE"
else:
stat_msg = f"Table={handler['table']}:Variable={handler['name']}:DataSupport=FALSE"
print_message(stat_msg, status="info")
continue
allpass = False

if allpass:
stat_msg = f"Table={handler['table']}:Variable={handler['name']}:DataSupport=TRUE"
else:
stat_msg = f"Table={handler['table']}:Variable={handler['name']}:DataSupport=FALSE"
print_message(stat_msg, status="info")

if self.info_out_path is not None:
with open(self.info_out_path, "w") as outstream:
Expand Down

0 comments on commit 093800c

Please sign in to comment.