Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
lee1043 committed Jan 8, 2025
1 parent 2340fb5 commit d4e7450
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pcmdi_metrics/mean_climate/lib/calculate_climatology.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,15 @@ def calculate_climatology(
# Plot climatology for each level
for level in levels_to_plot:
output_filename = out_season.replace(".nc", ".png")
if level is not None and var in output_filename:
output_filename = output_filename.replace(var, f"{var}-{level}.png")
if level is not None:
if var in output_filename:
output_filename = output_filename.replace(
var, f"{var}-{level}.png"
)
else:
output_filename = output_filename.replace(
".png", f"-{level}.png"
)

# plot climatology for each level
plot_climatology(
Expand Down

0 comments on commit d4e7450

Please # to comment.