From 541452e24e83c8c9f91e632297744785690a3ddc Mon Sep 17 00:00:00 2001 From: Jiwoo Lee Date: Wed, 8 Jan 2025 13:59:30 -0800 Subject: [PATCH] clean up --- .../mean_climate/lib/calculate_climatology.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/pcmdi_metrics/mean_climate/lib/calculate_climatology.py b/pcmdi_metrics/mean_climate/lib/calculate_climatology.py index edf6868bf..1d4f93f32 100644 --- a/pcmdi_metrics/mean_climate/lib/calculate_climatology.py +++ b/pcmdi_metrics/mean_climate/lib/calculate_climatology.py @@ -76,8 +76,8 @@ def calculate_climatology( # Subset given time period d = d.sel( time=slice( - start_yr_str + "-" + start_mo_str + "-" + start_da_str, - end_yr_str + "-" + end_mo_str + "-" + end_da_str, + f"{start_yr_str}-{start_mo_str}-{start_da_str}", + f"{end_yr_str}-{end_mo_str}-{end_da_str}", ) ) @@ -113,17 +113,7 @@ def calculate_climatology( # Save to netcdf file if periodinname is None: addf = ( - "." - + start_yr_str - + start_mo_str - + "-" - + end_yr_str - + end_mo_str - + "." - + s - + "." - + ver - + ".nc" + f".{start_yr_str}{start_mo_str}-{end_yr_str}{end_mo_str}.{s}.{ver}.nc" ) if periodinname is not None: addf = "." + s + "." + ver + ".nc"