Skip to content

Commit

Permalink
correctly indentify variables that need the _min, _max suffix (#44)
Browse files Browse the repository at this point in the history
Co-authored-by: Uriel Ramirez <[email protected]>
  • Loading branch information
uramirez8707 and Uriel Ramirez authored May 3, 2024
1 parent 987cc3a commit f75038e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fms_yaml_tools/diag_table/diag_table_to_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,12 @@ def construct_yaml(self,
# Ensure that the output_name contains "min"
# if the reduction method is "min"
output_name = tmp_dict['output_name'].lower()
if tmp_dict['reduction'] == "min" and "min" not in output_name:
if tmp_dict['reduction'] == "min" and "min" not in output_name[-3:]:
tmp_dict['output_name'] = tmp_dict['output_name'] + "_min"

# Ensure that the output_name contains "max"
# if the reduction method is "max"
if tmp_dict['reduction'] == "max" and "max" not in output_name:
if tmp_dict['reduction'] == "max" and "max" not in output_name[-3:]:
tmp_dict['output_name'] = tmp_dict['output_name'] + "_max"

# If the output_name and the var_name are the same
Expand Down

0 comments on commit f75038e

Please sign in to comment.